Add check for BSD when setting LIB_NAMES for GNU ld

Patch by Koop Mast and Alex Arslan!

Differential Revision: https://reviews.llvm.org/D28215



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298798 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Wilkins 2017-03-26 05:58:48 +00:00
parent 627e0f9985
commit c61c2fdaea

View File

@ -37,7 +37,7 @@ endif()
add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES})
list(REMOVE_DUPLICATES LIB_NAMES)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR MINGW) # FIXME: It should be "GNU ld for elf"
if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")) # FIXME: It should be "GNU ld for elf"
# GNU ld doesn't resolve symbols in the version script.
set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")