@@ -222,6 +222,11 @@ if(builtin_llvm)
222
222
223
223
set (LLVM_ENABLE_PROJECTS "clang" CACHE STRING "" )
224
224
225
+ # Always build LLVM with C++17. It is not necessary to compile with the same
226
+ # C++ standard as the rest of ROOT and sometimes it doesn't even work.
227
+ set (_cxx_standard ${CMAKE_CXX_STANDARD} )
228
+ set (CMAKE_CXX_STANDARD 17)
229
+
225
230
#---Reduce log level to suppress STATUS messages from LLVM
226
231
if (NOT DEFINED CMAKE_MESSAGE_LOG_LEVEL)
227
232
set (CMAKE_MESSAGE_LOG_LEVEL "NOTICE" )
@@ -239,6 +244,8 @@ if(builtin_llvm)
239
244
unset (CMAKE_MESSAGE_LOG_LEVEL)
240
245
endif ()
241
246
247
+ set (CMAKE_CXX_STANDARD ${_cxx_standard} )
248
+
242
249
set (LLVM_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} /llvm-project/llvm/include
243
250
${CMAKE_CURRENT_BINARY_DIR} /llvm-project/llvm/include
244
251
CACHE STRING "LLVM include directories."
@@ -453,7 +460,14 @@ else()
453
460
# Disable linking against shared LLVM
454
461
set (LLVM_LINK_LLVM_DYLIB OFF )
455
462
463
+ # Always build LLVM with C++17. It is not necessary to compile with the same
464
+ # C++ standard as the rest of ROOT and sometimes it doesn't even work.
465
+ set (_cxx_standard ${CMAKE_CXX_STANDARD} )
466
+ set (CMAKE_CXX_STANDARD 17)
467
+
456
468
add_subdirectory (llvm-project/clang EXCLUDE_FROM_ALL )
469
+
470
+ set (CMAKE_CXX_STANDARD ${_cxx_standard} )
457
471
endif (builtin_clang)
458
472
459
473
set ( CLANG_BUILT_STANDALONE 1 )
0 commit comments