From 5d035c5d8fe6f8a20ba8d1b749f0f91100ae347a Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 13 Nov 2019 20:29:19 -0800 Subject: [PATCH] [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 --- llvm/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 0aa22c6..2a6ec2b 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -584,6 +584,10 @@ else() option(LLVM_BUILD_LLVM_DYLIB "Build libllvm dynamic library" ${LLVM_BUILD_LLVM_DYLIB_default}) endif() +if (LLVM_LINK_LLVM_DYLIB AND BUILD_SHARED_LIBS) + message(FATAL_ERROR "Cannot enable BUILD_SHARED_LIBS with LLVM_LINK_LLVM_DYLIB. We recommend disabling BUILD_SHARED_LIBS.") +endif() + option(LLVM_OPTIMIZED_TABLEGEN "Force TableGen to be built with optimization" OFF) if(CMAKE_CROSSCOMPILING OR (LLVM_OPTIMIZED_TABLEGEN AND (LLVM_ENABLE_ASSERTIONS OR CMAKE_CONFIGURATION_TYPES))) set(LLVM_USE_HOST_TOOLS ON) -- 2.7.4