@@ -209,6 +209,11 @@ if(builtin_llvm)
209209
210210 set (LLVM_ENABLE_PROJECTS "clang" CACHE STRING "" )
211211
212+ # Always build LLVM with C++17. It is not necessary to compile with the same
213+ # C++ standard as the rest of ROOT and sometimes it doesn't even work.
214+ set (_cxx_standard ${CMAKE_CXX_STANDARD} )
215+ set (CMAKE_CXX_STANDARD 17)
216+
212217 #---Reduce log level to suppress STATUS messages from LLVM
213218 if (NOT DEFINED CMAKE_MESSAGE_LOG_LEVEL)
214219 set (CMAKE_MESSAGE_LOG_LEVEL "NOTICE" )
@@ -226,6 +231,8 @@ if(builtin_llvm)
226231 unset (CMAKE_MESSAGE_LOG_LEVEL)
227232 endif ()
228233
234+ set (CMAKE_CXX_STANDARD ${_cxx_standard} )
235+
229236 set (LLVM_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} /llvm-project/llvm/include
230237 ${CMAKE_CURRENT_BINARY_DIR} /llvm-project/llvm/include
231238 CACHE STRING "LLVM include directories."
@@ -372,7 +379,14 @@ else()
372379 # Disable linking against shared LLVM
373380 set (LLVM_LINK_LLVM_DYLIB OFF )
374381
382+ # Always build LLVM with C++17. It is not necessary to compile with the same
383+ # C++ standard as the rest of ROOT and sometimes it doesn't even work.
384+ set (_cxx_standard ${CMAKE_CXX_STANDARD} )
385+ set (CMAKE_CXX_STANDARD 17)
386+
375387 add_subdirectory (llvm-project/clang EXCLUDE_FROM_ALL )
388+
389+ set (CMAKE_CXX_STANDARD ${_cxx_standard} )
376390 endif (builtin_clang)
377391
378392 set ( CLANG_BUILT_STANDALONE 1 )
0 commit comments