process-cpp: /build/process-cpp/src/process-cpp-3.0.1/build/CMakeFiles/3.19.2/CompilerIdCXX/CMakeCXXCompilerId.cpp Source File

process-cpp 3.0.0 A simple convenience library for handling processes in C++11.

CMakeCXXCompilerId.cpp
Go to the documentation of this file.
1 /* This source file must have a .cpp extension so that all C++ compilers
2 recognize the extension without flags. Borland does not know .cxx for
3 example. */
4 #ifndef __cplusplus
5 # error "A C compiler has been selected for C++."
6 #endif
7
8
9 /* Version number components: V=Version, R=Revision, P=Patch
10 Version date components: YYYY=Year, MM=Month, DD=Day */
11
12 #if defined(__COMO__)
13 # define COMPILER_ID "Comeau"
14 /* __COMO_VERSION__ = VRR */
15 # define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
16 # define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
17
18 #elif defined(__INTEL_COMPILER) || defined(__ICC)
19 # define COMPILER_ID "Intel"
20 # if defined(_MSC_VER)
21 # define SIMULATE_ID "MSVC"
22 # endif
23 # if defined(__GNUC__)
24 # define SIMULATE_ID "GNU"
25 # endif
26 /* __INTEL_COMPILER = VRP */
27 # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
28 # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
29 # if defined(__INTEL_COMPILER_UPDATE)
30 # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
31 # else
32 # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
33 # endif
34 # if defined(__INTEL_COMPILER_BUILD_DATE)
35 /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
36 # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
37 # endif
38 # if defined(_MSC_VER)
39 /* _MSC_VER = VVRR */
40 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
41 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
42 # endif
43 # if defined(__GNUC__)
44 # define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
45 # elif defined(__GNUG__)
46 # define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
47 # endif
48 # if defined(__GNUC_MINOR__)
49 # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
50 # endif
51 # if defined(__GNUC_PATCHLEVEL__)
52 # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
53 # endif
54
55 #elif defined(__PATHCC__)
56 # define COMPILER_ID "PathScale"
57 # define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
58 # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
59 # if defined(__PATHCC_PATCHLEVEL__)
60 # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
61 # endif
62
63 #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
64 # define COMPILER_ID "Embarcadero"
65 # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
66 # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
67 # define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
68
69 #elif defined(__BORLANDC__)
70 # define COMPILER_ID "Borland"
71 /* __BORLANDC__ = 0xVRR */
72 # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
73 # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
74
75 #elif defined(__WATCOMC__) && __WATCOMC__ < 1200
76 # define COMPILER_ID "Watcom"
77 /* __WATCOMC__ = VVRR */
78 # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
79 # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
80 # if (__WATCOMC__ % 10) > 0
81 # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
82 # endif
83
84 #elif defined(__WATCOMC__)
85 # define COMPILER_ID "OpenWatcom"
86 /* __WATCOMC__ = VVRP + 1100 */
87 # define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
88 # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
89 # if (__WATCOMC__ % 10) > 0
90 # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
91 # endif
92
93 #elif defined(__SUNPRO_CC)
94 # define COMPILER_ID "SunPro"
95 # if __SUNPRO_CC >= 0x5100
96 /* __SUNPRO_CC = 0xVRRP */
97 # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
98 # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
99 # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
100 # else
101 /* __SUNPRO_CC = 0xVRP */
102 # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
103 # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
104 # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
105 # endif
106
107 #elif defined(__HP_aCC)
108 # define COMPILER_ID "HP"
109 /* __HP_aCC = VVRRPP */
110 # define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
111 # define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
112 # define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
113
114 #elif defined(__DECCXX)
115 # define COMPILER_ID "Compaq"
116 /* __DECCXX_VER = VVRRTPPPP */
117 # define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
118 # define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
119 # define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
120
121 #elif defined(__IBMCPP__) && defined(__COMPILER_VER__)
122 # define COMPILER_ID "zOS"
123 /* __IBMCPP__ = VRP */
124 # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
125 # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
126 # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
127
128 #elif defined(__ibmxl__) && defined(__clang__)
129 # define COMPILER_ID "XLClang"
130 # define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
131 # define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
132 # define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
133 # define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
134
135
136 #elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
137 # define COMPILER_ID "XL"
138 /* __IBMCPP__ = VRP */
139 # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
140 # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
141 # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
142
143 #elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800
144 # define COMPILER_ID "VisualAge"
145 /* __IBMCPP__ = VRP */
146 # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
147 # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
148 # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
149
150 #elif defined(__PGI)
151 # define COMPILER_ID "PGI"
152 # define COMPILER_VERSION_MAJOR DEC(__PGIC__)
153 # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
154 # if defined(__PGIC_PATCHLEVEL__)
155 # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
156 # endif
157
158 #elif defined(_CRAYC)
159 # define COMPILER_ID "Cray"
160 # define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
161 # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
162
163 #elif defined(__TI_COMPILER_VERSION__)
164 # define COMPILER_ID "TI"
165 /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
166 # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
167 # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
168 # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
169
170 #elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version)
171 # define COMPILER_ID "Fujitsu"
172
173 #elif defined(__ghs__)
174 # define COMPILER_ID "GHS"
175 /* __GHS_VERSION_NUMBER = VVVVRP */
176 # ifdef __GHS_VERSION_NUMBER
177 # define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
178 # define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
179 # define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
180 # endif
181
182 #elif defined(__SCO_VERSION__)
183 # define COMPILER_ID "SCO"
184
185 #elif defined(__ARMCC_VERSION) && !defined(__clang__)
186 # define COMPILER_ID "ARMCC"
187 #if __ARMCC_VERSION >= 1000000
188 /* __ARMCC_VERSION = VRRPPPP */
189 # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
190 # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
191 # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
192 #else
193 /* __ARMCC_VERSION = VRPPPP */
194 # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
195 # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
196 # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
197 #endif
198
199
200 #elif defined(__clang__) && defined(__apple_build_version__)
201 # define COMPILER_ID "AppleClang"
202 # if defined(_MSC_VER)
203 # define SIMULATE_ID "MSVC"
204 # endif
205 # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
206 # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
207 # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
208 # if defined(_MSC_VER)
209 /* _MSC_VER = VVRR */
210 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
211 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
212 # endif
213 # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
214
215 #elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
216 # define COMPILER_ID "ARMClang"
217 # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
218 # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
219 # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
220 # define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
221
222 #elif defined(__clang__)
223 # define COMPILER_ID "Clang"
224 # if defined(_MSC_VER)
225 # define SIMULATE_ID "MSVC"
226 # endif
227 # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
228 # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
229 # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
230 # if defined(_MSC_VER)
231 /* _MSC_VER = VVRR */
232 # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
233 # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
234 # endif
235
236 #elif defined(__GNUC__) || defined(__GNUG__)
237 # define COMPILER_ID "GNU"
238 # if defined(__GNUC__)
239 # define COMPILER_VERSION_MAJOR DEC(__GNUC__)
240 # else
241 # define COMPILER_VERSION_MAJOR DEC(__GNUG__)
242 # endif
243 # if defined(__GNUC_MINOR__)
244 # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
245 # endif
246 # if defined(__GNUC_PATCHLEVEL__)
247 # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
248 # endif
249
250 #elif defined(_MSC_VER)
251 # define COMPILER_ID "MSVC"
252 /* _MSC_VER = VVRR */
253 # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
254 # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
255 # if defined(_MSC_FULL_VER)
256 # if _MSC_VER >= 1400
257 /* _MSC_FULL_VER = VVRRPPPPP */
258 # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
259 # else
260 /* _MSC_FULL_VER = VVRRPPPP */
261 # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
262 # endif
263 # endif
264 # if defined(_MSC_BUILD)
265 # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
266 # endif
267
268 #elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
269 # define COMPILER_ID "ADSP"
270 #if defined(__VISUALDSPVERSION__)
271 /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
272 # define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
273 # define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
274 # define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
275 #endif
276
277 #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
278 # define COMPILER_ID "IAR"
279 # if defined(__VER__) && defined(__ICCARM__)
280 # define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
281 # define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
282 # define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
283 # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
284 # elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__))
285 # define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
286 # define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
287 # define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
288 # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
289 # endif
290
291
292 /* These compilers are either not known or too old to define an
293 identification macro. Try to identify the platform and guess that
294 it is the native compiler. */
295 #elif defined(__hpux) || defined(__hpua)
296 # define COMPILER_ID "HP"
297
298 #else /* unknown compiler */
299 # define COMPILER_ID ""
300 #endif
301
302 /* Construct the string literal in pieces to prevent the source from
303 getting matched. Store it in a pointer rather than an array
304 because some compilers will just produce instructions to fill the
305 array rather than assigning a pointer to a static array. */
306 char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
307 #ifdef SIMULATE_ID
308 char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
309 #endif
310
311 #ifdef __QNXNTO__
312 char const* qnxnto = "INFO" ":" "qnxnto[]";
313 #endif
314
315 #if defined(_CRAYC) || defined(__cray__)
316 char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
317 #endif
318
319 #define STRINGIFY_HELPER(X) #X
320 #define STRINGIFY(X) STRINGIFY_HELPER(X)
321
322 /* Identify known platforms by name. */
323 #if defined(__linux) || defined(__linux__) || defined(linux)
324 # define PLATFORM_ID "Linux"
325
326 #elif defined(__CYGWIN__)
327 # define PLATFORM_ID "Cygwin"
328
329 #elif defined(__MINGW32__)
330 # define PLATFORM_ID "MinGW"
331
332 #elif defined(__APPLE__)
333 # define PLATFORM_ID "Darwin"
334
335 #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
336 # define PLATFORM_ID "Windows"
337
338 #elif defined(__FreeBSD__) || defined(__FreeBSD)
339 # define PLATFORM_ID "FreeBSD"
340
341 #elif defined(__NetBSD__) || defined(__NetBSD)
342 # define PLATFORM_ID "NetBSD"
343
344 #elif defined(__OpenBSD__) || defined(__OPENBSD)
345 # define PLATFORM_ID "OpenBSD"
346
347 #elif defined(__sun) || defined(sun)
348 # define PLATFORM_ID "SunOS"
349
350 #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
351 # define PLATFORM_ID "AIX"
352
353 #elif defined(__hpux) || defined(__hpux__)
354 # define PLATFORM_ID "HP-UX"
355
356 #elif defined(__HAIKU__)
357 # define PLATFORM_ID "Haiku"
358
359 #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
360 # define PLATFORM_ID "BeOS"
361
362 #elif defined(__QNX__) || defined(__QNXNTO__)
363 # define PLATFORM_ID "QNX"
364
365 #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
366 # define PLATFORM_ID "Tru64"
367
368 #elif defined(__riscos) || defined(__riscos__)
369 # define PLATFORM_ID "RISCos"
370
371 #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
372 # define PLATFORM_ID "SINIX"
373
374 #elif defined(__UNIX_SV__)
375 # define PLATFORM_ID "UNIX_SV"
376
377 #elif defined(__bsdos__)
378 # define PLATFORM_ID "BSDOS"
379
380 #elif defined(_MPRAS) || defined(MPRAS)
381 # define PLATFORM_ID "MP-RAS"
382
383 #elif defined(__osf) || defined(__osf__)
384 # define PLATFORM_ID "OSF1"
385
386 #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
387 # define PLATFORM_ID "SCO_SV"
388
389 #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
390 # define PLATFORM_ID "ULTRIX"
391
392 #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
393 # define PLATFORM_ID "Xenix"
394
395 #elif defined(__WATCOMC__)
396 # if defined(__LINUX__)
397 # define PLATFORM_ID "Linux"
398
399 # elif defined(__DOS__)
400 # define PLATFORM_ID "DOS"
401
402 # elif defined(__OS2__)
403 # define PLATFORM_ID "OS2"
404
405 # elif defined(__WINDOWS__)
406 # define PLATFORM_ID "Windows3x"
407
408 # elif defined(__VXWORKS__)
409 # define PLATFORM_ID "VxWorks"
410
411 # else /* unknown platform */
412 # define PLATFORM_ID
413 # endif
414
415 #elif defined(__INTEGRITY)
416 # if defined(INT_178B)
417 # define PLATFORM_ID "Integrity178"
418
419 # else /* regular Integrity */
420 # define PLATFORM_ID "Integrity"
421 # endif
422
423 #else /* unknown platform */
424 # define PLATFORM_ID
425
426 #endif
427
428 /* For windows compilers MSVC and Intel we can determine
429 the architecture of the compiler being used. This is because
430 the compilers do not have flags that can change the architecture,
431 but rather depend on which compiler is being used
432 */
433 #if defined(_WIN32) && defined(_MSC_VER)
434 # if defined(_M_IA64)
435 # define ARCHITECTURE_ID "IA64"
436
437 # elif defined(_M_X64) || defined(_M_AMD64)
438 # define ARCHITECTURE_ID "x64"
439
440 # elif defined(_M_IX86)
441 # define ARCHITECTURE_ID "X86"
442
443 # elif defined(_M_ARM64)
444 # define ARCHITECTURE_ID "ARM64"
445
446 # elif defined(_M_ARM)
447 # if _M_ARM == 4
448 # define ARCHITECTURE_ID "ARMV4I"
449 # elif _M_ARM == 5
450 # define ARCHITECTURE_ID "ARMV5I"
451 # else
452 # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
453 # endif
454
455 # elif defined(_M_MIPS)
456 # define ARCHITECTURE_ID "MIPS"
457
458 # elif defined(_M_SH)
459 # define ARCHITECTURE_ID "SHx"
460
461 # else /* unknown architecture */
462 # define ARCHITECTURE_ID ""
463 # endif
464
465 #elif defined(__WATCOMC__)
466 # if defined(_M_I86)
467 # define ARCHITECTURE_ID "I86"
468
469 # elif defined(_M_IX86)
470 # define ARCHITECTURE_ID "X86"
471
472 # else /* unknown architecture */
473 # define ARCHITECTURE_ID ""
474 # endif
475
476 #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
477 # if defined(__ICCARM__)
478 # define ARCHITECTURE_ID "ARM"
479
480 # elif defined(__ICCRX__)
481 # define ARCHITECTURE_ID "RX"
482
483 # elif defined(__ICCRH850__)
484 # define ARCHITECTURE_ID "RH850"
485
486 # elif defined(__ICCRL78__)
487 # define ARCHITECTURE_ID "RL78"
488
489 # elif defined(__ICCRISCV__)
490 # define ARCHITECTURE_ID "RISCV"
491
492 # elif defined(__ICCAVR__)
493 # define ARCHITECTURE_ID "AVR"
494
495 # elif defined(__ICC430__)
496 # define ARCHITECTURE_ID "MSP430"
497
498 # elif defined(__ICCV850__)
499 # define ARCHITECTURE_ID "V850"
500
501 # elif defined(__ICC8051__)
502 # define ARCHITECTURE_ID "8051"
503
504 # else /* unknown architecture */
505 # define ARCHITECTURE_ID ""
506 # endif
507
508 #elif defined(__ghs__)
509 # if defined(__PPC64__)
510 # define ARCHITECTURE_ID "PPC64"
511
512 # elif defined(__ppc__)
513 # define ARCHITECTURE_ID "PPC"
514
515 # elif defined(__ARM__)
516 # define ARCHITECTURE_ID "ARM"
517
518 # elif defined(__x86_64__)
519 # define ARCHITECTURE_ID "x64"
520
521 # elif defined(__i386__)
522 # define ARCHITECTURE_ID "X86"
523
524 # else /* unknown architecture */
525 # define ARCHITECTURE_ID ""
526 # endif
527
528 #elif defined(__TI_COMPILER_VERSION__)
529 # if defined(__TI_ARM__)
530 # define ARCHITECTURE_ID "ARM"
531
532 # elif defined(__MSP430__)
533 # define ARCHITECTURE_ID "MSP430"
534
535 # elif defined(__TMS320C28XX__)
536 # define ARCHITECTURE_ID "TMS320C28x"
537
538 # elif defined(__TMS320C6X__) || defined(_TMS320C6X)
539 # define ARCHITECTURE_ID "TMS320C6x"
540
541 # else /* unknown architecture */
542 # define ARCHITECTURE_ID ""
543 # endif
544
545 #else
546 # define ARCHITECTURE_ID
547 #endif
548
549 /* Convert integer to decimal digit literals. */
550 #define DEC(n) \
551 ('0' + (((n) / 10000000)%10)), \
552 ('0' + (((n) / 1000000)%10)), \
553 ('0' + (((n) / 100000)%10)), \
554 ('0' + (((n) / 10000)%10)), \
555 ('0' + (((n) / 1000)%10)), \
556 ('0' + (((n) / 100)%10)), \
557 ('0' + (((n) / 10)%10)), \
558 ('0' + ((n) % 10))
559
560 /* Convert integer to hex digit literals. */
561 #define HEX(n) \
562 ('0' + ((n)>>28 & 0xF)), \
563 ('0' + ((n)>>24 & 0xF)), \
564 ('0' + ((n)>>20 & 0xF)), \
565 ('0' + ((n)>>16 & 0xF)), \
566 ('0' + ((n)>>12 & 0xF)), \
567 ('0' + ((n)>>8 & 0xF)), \
568 ('0' + ((n)>>4 & 0xF)), \
569 ('0' + ((n) & 0xF))
570
571 /* Construct a string literal encoding the version number components. */
572 #ifdef COMPILER_VERSION_MAJOR
573 char const info_version[] = {
574 'I', 'N', 'F', 'O', ':',
575 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
576 COMPILER_VERSION_MAJOR,
577 # ifdef COMPILER_VERSION_MINOR
578 '.', COMPILER_VERSION_MINOR,
579 # ifdef COMPILER_VERSION_PATCH
580 '.', COMPILER_VERSION_PATCH,
581 # ifdef COMPILER_VERSION_TWEAK
582 '.', COMPILER_VERSION_TWEAK,
583 # endif
584 # endif
585 # endif
586 ']','\0'};
587 #endif
588
589 /* Construct a string literal encoding the internal version number. */
590 #ifdef COMPILER_VERSION_INTERNAL
591 char const info_version_internal[] = {
592 'I', 'N', 'F', 'O', ':',
593 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
594 'i','n','t','e','r','n','a','l','[',
595 COMPILER_VERSION_INTERNAL,']','\0'};
596 #endif
597
598 /* Construct a string literal encoding the version number components. */
599 #ifdef SIMULATE_VERSION_MAJOR
600 char const info_simulate_version[] = {
601 'I', 'N', 'F', 'O', ':',
602 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
603 SIMULATE_VERSION_MAJOR,
604 # ifdef SIMULATE_VERSION_MINOR
605 '.', SIMULATE_VERSION_MINOR,
606 # ifdef SIMULATE_VERSION_PATCH
607 '.', SIMULATE_VERSION_PATCH,
608 # ifdef SIMULATE_VERSION_TWEAK
609 '.', SIMULATE_VERSION_TWEAK,
610 # endif
611 # endif
612 # endif
613 ']','\0'};
614 #endif
615
616 /* Construct the string literal in pieces to prevent the source from
617 getting matched. Store it in a pointer rather than an array
618 because some compilers will just produce instructions to fill the
619 array rather than assigning a pointer to a static array. */
620 char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
621 char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
622
623
624
625 #if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
626 # if defined(__INTEL_CXX11_MODE__)
627 # if defined(__cpp_aggregate_nsdmi)
628 # define CXX_STD 201402L
629 # else
630 # define CXX_STD 201103L
631 # endif
632 # else
633 # define CXX_STD 199711L
634 # endif
635 #elif defined(_MSC_VER) && defined(_MSVC_LANG)
636 # define CXX_STD _MSVC_LANG
637 #else
638 # define CXX_STD __cplusplus
639 #endif
640
641 const char* info_language_dialect_default = "INFO" ":" "dialect_default["
642 #if CXX_STD > 201703L
643 "20"
644 #elif CXX_STD >= 201703L
645 "17"
646 #elif CXX_STD >= 201402L
647 "14"
648 #elif CXX_STD >= 201103L
649 "11"
650 #else
651 "98"
652 #endif
653 "]";
654
655 /*--------------------------------------------------------------------------*/
656
657 int main(int argc, char* argv[])
658 {
659 int require = 0;
660 require += info_compiler[argc];
661 require += info_platform[argc];
662 #ifdef COMPILER_VERSION_MAJOR
663 require += info_version[argc];
664 #endif
665 #ifdef COMPILER_VERSION_INTERNAL
666 require += info_version_internal[argc];
667 #endif
668 #ifdef SIMULATE_ID
669 require += info_simulate[argc];
670 #endif
671 #ifdef SIMULATE_VERSION_MAJOR
672 require += info_simulate_version[argc];
673 #endif
674 #if defined(_CRAYC) || defined(__cray__)
675 require += info_cray[argc];
676 #endif
677 require += info_language_dialect_default[argc];
678 (void)argv;
679 return require;
680 }
COMPILER_ID
#define COMPILER_ID
Definition: CMakeCXXCompilerId.cpp:299
ARCHITECTURE_ID
#define ARCHITECTURE_ID
Definition: CMakeCXXCompilerId.cpp:546
main
int main(int argc, char *argv[])
Definition: CMakeCXXCompilerId.cpp:657
info_compiler
char const * info_compiler
Definition: CMakeCXXCompilerId.cpp:306
info_arch
char const * info_arch
Definition: CMakeCXXCompilerId.cpp:621
info_platform
char const * info_platform
Definition: CMakeCXXCompilerId.cpp:620
PLATFORM_ID
#define PLATFORM_ID
Definition: CMakeCXXCompilerId.cpp:424
info_language_dialect_default
const char * info_language_dialect_default
Definition: CMakeCXXCompilerId.cpp:641