Skip to content

Commit 7db0415

Browse files
committed
[CMake] Disable linking against shared LLVM also for builtin_clang=OFF
Disable linking against shared LLVM also for `builtin_clang=OFF`. We have to do this after find_package(Clang). Finding Clang internally calls find_package(LLVM), which overwrites LLVM_LINK_LLVM_DYLIB to what it was set when building LLVM.
1 parent 9b20bb1 commit 7db0415

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

interpreter/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,12 @@ if (builtin_clang)
407407
else()
408408
find_package(Clang REQUIRED CONFIG)
409409
message(STATUS "Found Clang ${CLANG_PACKAGE_VERSION} in ${CLANG_CMAKE_DIR}")
410+
411+
# Disable linking against shared LLVM.
412+
# We have to do this after find_package(Clang). Finding Clang internally
413+
# calls find_package(LLVM), which overwrites LLVM_LINK_LLVM_DYLIB to what it
414+
# was set when building LLVM.
415+
set(LLVM_LINK_LLVM_DYLIB FALSE)
410416
endif()
411417

412418
# Reset the compiler flags after compiling LLVM and Clang

0 commit comments

Comments
 (0)