[Mlir-commits] [mlir] [mlir] Fix MLIR dylib CMake config when LLVM_BUILD_LLVM_DYLIB is OFF (PR #155488)
Christopher Bate
llvmlistbot at llvm.org
Fri Sep 12 10:18:09 PDT 2025
================
@@ -172,8 +172,11 @@ set(MLIR_INSTALL_AGGREGATE_OBJECTS 1 CACHE BOOL
set(MLIR_BUILD_MLIR_C_DYLIB 0 CACHE BOOL "Builds libMLIR-C shared library.")
-set(MLIR_LINK_MLIR_DYLIB ${LLVM_LINK_LLVM_DYLIB} CACHE BOOL
- "Link tools against libMLIR.so")
+set(MLIR_BUILD_MLIR_DYLIB 0 CACHE BOOL "Builds the libMLIR shared library")
+set(MLIR_LINK_MLIR_DYLIB ${LLVM_LINK_LLVM_DYLIB} CACHE BOOL "Link tools against libMLIR.so")
+if (MLIR_LINK_MLIR_DYLIB)
----------------
christopherbate wrote:
I think `cmake_dependent_option` does make sense, but in this case it would be used to define the `MLIR_LINK_MLIR_DYLIB` instead (since you can only link the dylib if you build the dylib).
I'd prefer your current code actually over using the `_default` since it's less verbose.
Personally I prefer to just `message(FATAL_ERROR ...)` when there are CMake options under the user's control that are set to incompatible values. But in this case it looks like that would break downstream builds.
https://github.com/llvm/llvm-project/pull/155488
More information about the Mlir-commits
mailing list