Skip to content

Commit 5d035c5

Browse files
committed
[cmake] Prevent building with BUILD_SHARED_LIBS and LLVM_LINK_LLVM_DYLIB
Summary: This doesn't work, so error early if someone tries it. Reviewers: beanz, smeenai, compnerd, phosek Reviewed By: beanz Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70160
1 parent 91c5928 commit 5d035c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,10 @@ else()
584584
option(LLVM_BUILD_LLVM_DYLIB "Build libllvm dynamic library"${LLVM_BUILD_LLVM_DYLIB_default})
585585
endif()
586586

587+
if (LLVM_LINK_LLVM_DYLIB ANDBUILD_SHARED_LIBS)
588+
message(FATAL_ERROR "Cannot enable BUILD_SHARED_LIBS with LLVM_LINK_LLVM_DYLIB. We recommend disabling BUILD_SHARED_LIBS.")
589+
endif()
590+
587591
option(LLVM_OPTIMIZED_TABLEGEN "Force TableGen to be built with optimization"OFF)
588592
if(CMAKE_CROSSCOMPILINGOR (LLVM_OPTIMIZED_TABLEGEN AND (LLVM_ENABLE_ASSERTIONS ORCMAKE_CONFIGURATION_TYPES)))
589593
set(LLVM_USE_HOST_TOOLS ON)

0 commit comments

Comments
 (0)
close