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
20 changes: 3 additions & 17 deletions interpreter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -391,30 +391,16 @@ else()
# install-clang-cpp target defined by LLVM's cmake module
set(CLANG_LINKS_TO_CREATE clang++ clang-cl)

# 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.
# 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()
# Clang defaults this to LLVM_LINK_LLVM_DYLIB, which LLVMConfig.cmake may set to
# ON; ROOT links no Clang tool against libclang-cpp.
set(CLANG_LINK_CLANG_DYLIB OFF CACHE BOOL "Link Clang tools against libclang-cpp")

# 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