From 5737f6a527d782e6577e5cc1e0c743df2c98546a Mon Sep 17 00:00:00 2001 From: Shoaib Meenai Date: Tue, 16 Aug 2022 16:24:42 -0700 Subject: [PATCH] [compiler-rt] Build with C++17 explicitly We've started using C++17 constructs in compiler-rt now (e.g. string_view in ORC), but when using the bootstrapping build, we won't inherit the C++ standard from LLVM, and compilation may fail if we default to an older standard. Explicitly build compiler-rt with C++17 in a standalone build, which matches what other subprojects (e.g. Clang and LLD) do. --- compiler-rt/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index 4f8e095..e568866 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -68,6 +68,10 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL "Build for a bare-metal target.") if (COMPILER_RT_STANDALONE_BUILD) + set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to") + set(CMAKE_CXX_STANDARD_REQUIRED YES) + set(CMAKE_CXX_EXTENSIONS NO) + load_llvm_config() if (TARGET intrinsics_gen) # Loading the llvm config causes this target to be imported so place it -- 2.7.4