Skip to content

Commit 6dd434c

Browse files
committed
cmake: add XL C/C++ support (theoretically)
1 parent 547b11d commit 6dd434c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
3535
else()
3636
message(FATAL_ERROR "No C++11 support for Clang version. Please upgrade Clang to a version supporting C++11.")
3737
endif()
38+
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES XL)
39+
# NOTE: This branch is not tested yet (in theory it should work)
40+
check_cxx_compiler_flag(-qlanglvl=extended0x HAVE_STD11)
41+
if(HAVE_STD11)
42+
add_to_string_list("${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS "-qlanglvl=extended0x -qwarn0x")
43+
else()
44+
message(FATAL_ERROR "No advanced standard C++ support of your IBM XL C/C++ compiler (-qlanglvl=extended0x not defined).")
45+
endif()
3846
else()
3947
message(FATAL_ERROR "Don't know how to check C++11 compatibility with compiler '${CMAKE_CXX_COMPILER_ID}'")
4048
endif()

0 commit comments

Comments
 (0)