[llvm] r201317 - [CMake] llvm_add_library(MODULE) may use CMAKE_MODULE_LINKER_FLAGS instead of target property LINK_FLAGS.
NAKAMURA Takumi
geek4civic at gmail.com
Thu Feb 13 03:19:11 PST 2014
Author: chapuni
Date: Thu Feb 13 05:19:11 2014
New Revision: 201317
URL: http://llvm.org/viewvc/llvm-project?rev=201317&view=rev
Log:
[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.
Modified:
llvm/trunk/cmake/modules/AddLLVM.cmake
llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=201317&r1=201316&r2=201317&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Thu Feb 13 05:19:11 2014
@@ -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()
Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=201317&r1=201316&r2=201317&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Thu Feb 13 05:19:11 2014
@@ -105,6 +105,11 @@ set(LTDL_SHLIB_EXT ${CMAKE_SHARED_LIBRAR
# 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)
More information about the llvm-commits
mailing list