diff options
author | Chris Bieneman <beanz@apple.com> | 2016-05-25 17:08:43 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2016-05-25 17:08:43 +0000 |
commit | b136a25c5cfdb32285133cee7a8ecc01cc1645c2 (patch) | |
tree | 81d190b9d7cc7c5e14f957413b9eb6097315fd61 /llvm/tools/llvm-shlib | |
parent | fa57367ae5bdf7482414f643af204f565bfb3c06 (diff) | |
download | bcm5719-llvm-b136a25c5cfdb32285133cee7a8ecc01cc1645c2.tar.gz bcm5719-llvm-b136a25c5cfdb32285133cee7a8ecc01cc1645c2.zip |
[CMake] LINK_LIBS need to be public for Darwin dylib targets
This should actually address PR27855. This results in adding references to the system libs inside generated dylibs so that they get correctly pulled in when linking against the dylib.
llvm-svn: 270723
Diffstat (limited to 'llvm/tools/llvm-shlib')
-rw-r--r-- | llvm/tools/llvm-shlib/CMakeLists.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/tools/llvm-shlib/CMakeLists.txt b/llvm/tools/llvm-shlib/CMakeLists.txt index 3fe672d679a..69a4e43c336 100644 --- a/llvm/tools/llvm-shlib/CMakeLists.txt +++ b/llvm/tools/llvm-shlib/CMakeLists.txt @@ -38,6 +38,17 @@ endif() add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES}) +if(APPLE) + set(library_type PUBLIC) +else() + # We can use PRIVATE since SO knows its dependent libs. + set(library_type PRIVATE) +endif() + +get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) + +target_link_libraries(LLVM ${library_type} ${system_libs}) + list(REMOVE_DUPLICATES LIB_NAMES) if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") # FIXME: It should be "GNU ld for elf" # GNU ld doesn't resolve symbols in the version script. |