From 83ff676c50f37c513ed97757f34f35337c635014 Mon Sep 17 00:00:00 2001 From: arezaii Date: Mon, 4 Dec 2023 15:23:12 -0700 Subject: [PATCH] chpldoc:adjust cxx standard based on LLVM version Signed-off-by: arezaii --- tools/chpldoc/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/chpldoc/CMakeLists.txt b/tools/chpldoc/CMakeLists.txt index 3d253e39dd01..3f0ef6736a4a 100644 --- a/tools/chpldoc/CMakeLists.txt +++ b/tools/chpldoc/CMakeLists.txt @@ -28,7 +28,13 @@ add_custom_command( COMMENT "writing COPYRIGHT file updates..." VERBATIM) add_executable(chpldoc chpldoc.cpp arg.cpp arg-helpers.cpp COPYRIGHT) -set_property(TARGET chpldoc PROPERTY CXX_STANDARD 17) +# request C++14 -- or C++17 if using LLVM 16 +if (CHPL_LLVM_VERSION VERSION_LESS 16.0) + set(CMAKE_CXX_STANDARD 14) +else() + set(CMAKE_CXX_STANDARD 17) +endif() +set(CMAKE_CXX_STANDARD_REQUIRED True) target_link_libraries(chpldoc ChplFrontend) target_include_directories(chpldoc PRIVATE ${CHPL_MAIN_INCLUDE_DIR}