Skip to content

Commit

Permalink
[CMake] llvm_add_library(MODULE) may use CMAKE_MODULE_LINKER_FLAGS in…
Browse files Browse the repository at this point in the history
…stead of target property LINK_FLAGS.

I mis-dropped Darwin's link flags (in clang side) since r201073.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201317 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
chapuni committed Feb 13, 2014
1 parent 38a10d0 commit 74c3f7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 0 additions & 6 deletions cmake/modules/AddLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,6 @@ ${name} ignored.")
llvm_add_library(${name} MODULE ${ARGN})
set_target_properties( ${name} PROPERTIES PREFIX "" )

if (APPLE)
# Darwin-specific linker flags for loadable modules.
set_property(TARGET ${name} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
endif()

if( EXCLUDE_FROM_ALL )
set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
else()
Expand Down
5 changes: 5 additions & 0 deletions cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ set(LTDL_SHLIB_EXT ${CMAKE_SHARED_LIBRARY_SUFFIX})
# We use *.dylib rather than *.so on darwin.
set(LLVM_PLUGIN_EXT ${CMAKE_SHARED_LIBRARY_SUFFIX})

if(APPLE)
# Darwin-specific linker flags for loadable modules.
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
endif()

function(add_flag_or_print_warning flag)
check_c_compiler_flag(${flag} C_SUPPORTS_FLAG)
check_cxx_compiler_flag(${flag} CXX_SUPPORTS_FLAG)
Expand Down

0 comments on commit 74c3f7d

Please sign in to comment.