[lld] Require C++14 in LLD standalone build
authorJez Ng <jezng@fb.com>
Tue, 22 Feb 2022 23:14:47 +0000 (18:14 -0500)
committerJez Ng <jezng@fb.com>
Tue, 22 Feb 2022 23:15:29 +0000 (18:15 -0500)
This is what the Clang standalone build does too. And setting this
seems to be required to get the standalone build to work on my Mac.

Reviewed By: #lld-macho, MaskRay, Ericson2314, smeenai

Differential Revision: https://reviews.llvm.org/D120269

lld/CMakeLists.txt

index 9bcc135..f51c864 100644 (file)
@@ -11,6 +11,10 @@ endif()
 include(GNUInstallDirs)
 
 if(LLD_BUILT_STANDALONE)
+  set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to conform to")
+  set(CMAKE_CXX_STANDARD_REQUIRED YES)
+  set(CMAKE_CXX_EXTENSIONS NO)
+
   set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
   # Rely on llvm-config.