llvm.org GIT mirror llvm / c1beab6
Revert "[CMake] LINK_LIBS need to be public for Darwin dylib targets" This reverts r270723. This commit breaks greendragon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270820 91177308-0d34-0410-b5e6-96231b3b80d8 Steven Wu 4 years ago
2 changed file(s) with 15 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
488488
489489 if(CMAKE_VERSION VERSION_LESS 2.8.12)
490490 # Link libs w/o keywords, assuming PUBLIC.
491 set(library_type)
492 elseif(ARG_STATIC)
493 set(library_type INTERFACE)
494 elseif(APPLE)
495 set(library_type PUBLIC)
496 else()
497 # We can use PRIVATE since SO knows its dependent libs.
498 set(library_type PRIVATE)
499 endif()
500 target_link_libraries(${name} ${library_type}
491 target_link_libraries(${name}
501492 ${ARG_LINK_LIBS}
502493 ${lib_deps}
503494 ${llvm_libs}
504495 )
496 elseif(ARG_STATIC)
497 target_link_libraries(${name} INTERFACE
498 ${ARG_LINK_LIBS}
499 ${lib_deps}
500 ${llvm_libs}
501 )
502 else()
503 # We can use PRIVATE since SO knows its dependent libs.
504 target_link_libraries(${name} PRIVATE
505 ${ARG_LINK_LIBS}
506 ${lib_deps}
507 ${llvm_libs}
508 )
509 endif()
505510
506511 if(LLVM_COMMON_DEPENDS)
507512 add_dependencies(${name} ${LLVM_COMMON_DEPENDS})
3636 endif()
3737
3838 add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES})
39
40 if(APPLE)
41 set(library_type PUBLIC)
42 else()
43 # We can use PRIVATE since SO knows its dependent libs.
44 set(library_type PRIVATE)
45 endif()
46
47 get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS)
48
49 target_link_libraries(LLVM ${library_type} ${system_libs})
5039
5140 list(REMOVE_DUPLICATES LIB_NAMES)
5241 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") # FIXME: It should be "GNU ld for elf"