summaryrefslogtreecommitdiff
path: root/Modules/CMakeCXXCompilerId.cpp.in
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2021-05-29 16:54:41 +0300
committerRaul Tambre <raul@tambre.ee>2021-09-28 21:24:53 +0300
commitfc3a1cbdd81f350b897c6cd06d75e8e228514773 (patch)
tree8d87587807fcfeb6bfb1d506f3e7a3f2441389d9 /Modules/CMakeCXXCompilerId.cpp.in
parent2adfd95d793b516fdef2d02a60b9529f525f6374 (diff)
downloadcmake-fc3a1cbdd81f350b897c6cd06d75e8e228514773.tar.gz
CompilerID: Compiler extensions default detection
Diffstat (limited to 'Modules/CMakeCXXCompilerId.cpp.in')
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 51c901eb09..cdf9c1828a 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -65,6 +65,17 @@ const char* info_language_standard_default = "INFO" ":" "standard_default["
#endif
"]";
+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
+"]";
+
/*--------------------------------------------------------------------------*/
int main(int argc, char* argv[])
@@ -88,6 +99,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;
}