summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCXXCompilerId.cpp.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-04-03 18:26:18 (GMT)
committerBrad King <brad.king@kitware.com>2024-04-04 21:56:31 (GMT)
commit3587579f34235255db11a2d2b11668829f256790 (patch)
tree573b9af9be3a9d2863b3cd6506e26d0b5a429658 /Modules/CMakeCXXCompilerId.cpp.in
parent863cde8c19d63177da2212f06a0b7d93279e04c9 (diff)
downloadCMake-3587579f34235255db11a2d2b11668829f256790.zip
CMake-3587579f34235255db11a2d2b11668829f256790.tar.gz
CMake-3587579f34235255db11a2d2b11668829f256790.tar.bz2
XL/XLClang: Fix detection of C++ 14 mode on Linux
This compiler does not always define `__cplusplus` correctly, but does define a feature macro that we can use to distinguish this mode.
Diffstat (limited to 'Modules/CMakeCXXCompilerId.cpp.in')
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 3a334ed..2a92287 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -66,6 +66,12 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
# else
# define CXX_STD __cplusplus
# endif
+#elif (defined(__IBMCPP__) || defined(__ibmxl__)) && defined(__linux__)
+# if __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
+# define CXX_STD CXX_STD_14
+# else
+# define CXX_STD __cplusplus
+# endif
#else
# define CXX_STD __cplusplus
#endif