aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-10 15:30:33 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-10 15:30:33 +0000
commit878141685887b214a86e773c98926dee0526d927 (patch)
treed62f58fcd985b0b9a5df937028c8e82acfb6e5d3 /cmake/modules
parent710c37c494229334f59b9be328366807db2a7d01 (diff)
downloadexternal_llvm-878141685887b214a86e773c98926dee0526d927.zip
external_llvm-878141685887b214a86e773c98926dee0526d927.tar.gz
external_llvm-878141685887b214a86e773c98926dee0526d927.tar.bz2
CMake: Add Darwin-specific linker flags for building loadable modules
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86684 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/modules')
-rwxr-xr-xcmake/modules/AddLLVM.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index cb71b7e..c0ce897 100755
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -27,10 +27,16 @@ macro(add_llvm_loadable_module name)
message(STATUS "Loadable modules not supported on this platform.
${name} ignored.")
else()
- set(BUILD_SHARED_LIBS ON)
llvm_process_sources( ALL_FILES ${ARGN} )
add_library( ${name} MODULE ${ALL_FILES} )
set_target_properties( ${name} PROPERTIES PREFIX "" )
+
+ if (APPLE)
+ # Darwin-specific linker flags for loadable modules.
+ set_target_properties(${name} PROPERTIES
+ LINK_FLAGS "-Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
+ endif()
+
install(TARGETS ${name}
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})