Skip to content

[CMake] Only export the LLVM_LINK_LLVM_DYLIB setting if not yet set #135570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 0 additions & 5 deletions llvm/cmake/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ if (LLVM_BUILD_UTILS)
endif()
endif()

if (LLVM_LINK_LLVM_DYLIB)
set(LLVM_CONFIG_LINK_LLVM_DYLIB
"set(LLVM_LINK_LLVM_DYLIB ${LLVM_LINK_LLVM_DYLIB})")
endif()

# We need to use the full path to the LLVM Exports file to make sure we get the
# one from the build tree. This is due to our cmake files being split between
# this source dir and the binary dir in the build tree configuration and the
Expand Down
6 changes: 5 additions & 1 deletion llvm/cmake/modules/LLVMConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ set(LLVM_COMMON_DEPENDS @LLVM_COMMON_DEPENDS@)

set(LLVM_AVAILABLE_LIBS @LLVM_AVAILABLE_LIBS@)

@LLVM_CONFIG_LINK_LLVM_DYLIB@
# By only exporting the setting if it was not yet defined, out-of-tree
# clients get the correct default, but may still choose if they can.
if(@LLVM_LINK_LLVM_DYLIB@ AND NOT DEFINED LLVM_LINK_LLVM_DYLIB)
set(LLVM_LINK_LLVM_DYLIB @LLVM_LINK_LLVM_DYLIB@)
endif()

set(LLVM_DYLIB_COMPONENTS @LLVM_DYLIB_COMPONENTS@)

Expand Down