aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 cb71b7e960..c0ce897f4f 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})