Skip to content

Commit 5737f6a

Browse files
committed
[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.
1 parent cfd2c5c commit 5737f6a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler-rt/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL
6868
"Build for a bare-metal target.")
6969

7070
if (COMPILER_RT_STANDALONE_BUILD)
71+
set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to")
72+
set(CMAKE_CXX_STANDARD_REQUIRED YES)
73+
set(CMAKE_CXX_EXTENSIONS NO)
74+
7175
load_llvm_config()
7276
if (TARGET intrinsics_gen)
7377
# Loading the llvm config causes this target to be imported so place it

0 commit comments

Comments
 (0)