[lldb] Set CMAKE_CXX_STANDARD before including LLDBStandalone
authorJonas Devlieghere <jonas@devlieghere.com>
Mon, 15 May 2023 21:29:20 +0000 (14:29 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Mon, 15 May 2023 21:32:15 +0000 (14:32 -0700)
Set the C++ language standard before including LLDBStandalone.cmake.
Otherwise we risk building some of our dependencies (such as llvm_gtest)
without C++ 17 support.

This should fix the standalone bot [1] which is currently failing with the
following error:

  test-port.h:841:12: error: no member named 'tuple' in namespace 'std'
  using std::tuple;

[1] https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-standalone

lldb/CMakeLists.txt

index 9ae6722..4a53d7e 100644 (file)
@@ -27,11 +27,11 @@ include(GNUInstallDirs)
 option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests." ${LLVM_INCLUDE_TESTS})
 
 if(LLDB_BUILT_STANDALONE)
-  include(LLDBStandalone)
-
   set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to")
   set(CMAKE_CXX_STANDARD_REQUIRED YES)
   set(CMAKE_CXX_EXTENSIONS NO)
+
+  include(LLDBStandalone)
 endif()
 
 include(LLDBConfig)