Whe we build a shared library, add its list of used libraries to the
[oota-llvm.git] / cmake / modules / AddLLVM.cmake
index 764c6591c457ea8304636c85fa80e6c3c5289d8e..5e0e32acbc5942b2c2a9f6db8457177fe7cbe92d 100755 (executable)
@@ -10,6 +10,7 @@ macro(add_llvm_library name)
   endif( LLVM_COMMON_DEPENDS )
 
   if( BUILD_SHARED_LIBS )
+    llvm_config( ${name} ${LLVM_LINK_COMPONENTS} )
     get_system_libs(sl)
     target_link_libraries( ${name} ${sl} )
   endif()
@@ -45,6 +46,10 @@ ${name} ignored.")
     add_library( ${name} ${libkind} ${ALL_FILES} )
     set_target_properties( ${name} PROPERTIES PREFIX "" )
 
+    llvm_config( ${name} ${LLVM_LINK_COMPONENTS} )
+    get_system_libs(sl)
+    target_link_libraries( ${name} ${sl} )
+
     if (APPLE)
       # Darwin-specific linker flags for loadable modules.
       set_target_properties(${name} PROPERTIES