[compiler-rt] 5737f6a - [compiler-rt] Build with C++17 explicitly

Shoaib Meenai via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 16:26:48 PDT 2022


Author: Shoaib Meenai
Date: 2022-08-16T16:24:42-07:00
New Revision: 5737f6a527d782e6577e5cc1e0c743df2c98546a

URL: https://github.com/llvm/llvm-project/commit/5737f6a527d782e6577e5cc1e0c743df2c98546a
DIFF: https://github.com/llvm/llvm-project/commit/5737f6a527d782e6577e5cc1e0c743df2c98546a.diff

LOG: [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.

Added: 
    

Modified: 
    compiler-rt/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 4f8e095c3b913..e568866db33b8 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


        


More information about the llvm-commits mailing list