llvm.org GIT mirror llvm / 74c3f7d
[CMake] llvm_add_library(MODULE) may use CMAKE_MODULE_LINKER_FLAGS instead 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 NAKAMURA Takumi 5 years ago
2 changed file(s) with 5 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
286286 llvm_add_library(${name} MODULE ${ARGN})
287287 set_target_properties( ${name} PROPERTIES PREFIX "" )
288288
289 if (APPLE)
290 # Darwin-specific linker flags for loadable modules.
291 set_property(TARGET ${name} APPEND_STRING PROPERTY
292 LINK_FLAGS " -Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
293 endif()
294
295289 if( EXCLUDE_FROM_ALL )
296290 set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
297291 else()
104104 # We use *.dylib rather than *.so on darwin.
105105 set(LLVM_PLUGIN_EXT ${CMAKE_SHARED_LIBRARY_SUFFIX})
106106
107 if(APPLE)
108 # Darwin-specific linker flags for loadable modules.
109 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
110 endif()
111
107112 function(add_flag_or_print_warning flag)
108113 check_c_compiler_flag(${flag} C_SUPPORTS_FLAG)
109114 check_cxx_compiler_flag(${flag} CXX_SUPPORTS_FLAG)