[llvm-commits] [llvm] r86684 - /llvm/trunk/cmake/modules/AddLLVM.cmake

Douglas Gregor dgregor at apple.com
Tue Nov 10 07:30:33 PST 2009


Author: dgregor
Date: Tue Nov 10 09:30:33 2009
New Revision: 86684

URL: http://llvm.org/viewvc/llvm-project?rev=86684&view=rev
Log:
CMake: Add Darwin-specific linker flags for building loadable modules

Modified:
    llvm/trunk/cmake/modules/AddLLVM.cmake

Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=86684&r1=86683&r2=86684&view=diff

==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Tue Nov 10 09:30:33 2009
@@ -27,10 +27,16 @@
     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})





More information about the llvm-commits mailing list