[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.
This commit is contained in:
Shoaib Meenai 2022-08-16 16:24:42 -07:00
parent cfd2c5ce58
commit 5737f6a527
1 changed files with 4 additions and 0 deletions

View File

@ -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