summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCCompilerId.c.in
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2021-05-29 13:54:41 (GMT)
committerRaul Tambre <raul@tambre.ee>2021-09-28 18:24:53 (GMT)
commitfc3a1cbdd81f350b897c6cd06d75e8e228514773 (patch)
tree8d87587807fcfeb6bfb1d506f3e7a3f2441389d9 /Modules/CMakeCCompilerId.c.in
parent2adfd95d793b516fdef2d02a60b9529f525f6374 (diff)
downloadCMake-fc3a1cbdd81f350b897c6cd06d75e8e228514773.zip
CMake-fc3a1cbdd81f350b897c6cd06d75e8e228514773.tar.gz
CMake-fc3a1cbdd81f350b897c6cd06d75e8e228514773.tar.bz2
CompilerID: Compiler extensions default detection
Diffstat (limited to 'Modules/CMakeCCompilerId.c.in')
-rw-r--r--Modules/CMakeCCompilerId.c.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 9116190..43ede3e 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -59,6 +59,17 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
const char* info_language_standard_default =
"INFO" ":" "standard_default[" C_VERSION "]";
+const char* info_language_extensions_default = "INFO" ":" "extensions_default["
+// !defined(_MSC_VER) to exclude Clang's MSVC compatibility mode.
+#if (defined(__clang__) || defined(__GNUC__) || \
+ defined(__TI_COMPILER_VERSION__)) && \
+ !defined(__STRICT_ANSI__) && !defined(_MSC_VER)
+ "ON"
+#else
+ "OFF"
+#endif
+"]";
+
/*--------------------------------------------------------------------------*/
#ifdef ID_VOID_MAIN
@@ -90,6 +101,7 @@ int main(int argc, char* argv[])
require += info_cray[argc];
#endif
require += info_language_standard_default[argc];
+ require += info_language_extensions_default[argc];
(void)argv;
return require;
}