From 4262363d4bfa92425948e4f61d5505e5b0126af5 Mon Sep 17 00:00:00 2001 From: SASANO Takayoshi Date: Tue, 31 Dec 2024 19:02:15 +0900 Subject: [PATCH] add Clang++-16 and libc++(experimental) support --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6948010..0031fa8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,19 @@ if(DEFINED MSVC) add_definitions(-D_USE_MATH_DEFINES) endif() +if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17)) + include(CheckCXXSymbolExists) + if(cxx_std_20 IN_LIST CMAKE_CXX_COMPILE_FEATURES) + set(header version) + else() + set(header ciso646) + endif() + + check_cxx_symbol_exists(_LIBCPP_VERSION ${header} LIBCPP) + if(LIBCPP) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexperimental-library") + endif() +endif() add_subdirectory(libtermbench) add_subdirectory(tb)