Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion interpreter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,29 @@ else()

# Disable linking against shared LLVM
set(LLVM_LINK_LLVM_DYLIB OFF)
# To ensure this override stays constant, we need to avoid subdirectories calling find_package(LLVM),
# which would set it to ON again if system was compiled that way
# Define a macro with a toggle flag to override find_package, that will only be visible in this scope, not in parent one.
Comment thread
ferdymercury marked this conversation as resolved.
# TEMPORARY: remove this workaround once ROOT can link against the shared
# libLLVM.so for builtin_llvm=OFF
macro(find_package _package_name)
if(ROOT_SKIP_FIND_LLVM_WITHIN_CLANG AND "${_package_name}" STREQUAL "LLVM")
message(STATUS "[ROOT] Suppressed find_package(LLVM) at ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}"
" to keep LLVM_LINK_LLVM_DYLIB=OFF.")
else()
_find_package(${_package_name} ${ARGN})
endif()
endmacro()

# Always build LLVM with C++17. It is not necessary to compile with the same
# C++ standard as the rest of ROOT and sometimes it doesn't even work.
set(_cxx_standard ${CMAKE_CXX_STANDARD})
set(CMAKE_CXX_STANDARD 17)

set(ROOT_SKIP_FIND_LLVM_WITHIN_CLANG ON)
add_subdirectory(llvm-project/clang EXCLUDE_FROM_ALL)

set(ROOT_SKIP_FIND_LLVM_WITHIN_CLANG OFF)

set(CMAKE_CXX_STANDARD ${_cxx_standard})
endif(builtin_clang)

Expand Down
Loading