summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2011-03-12 16:48:54 +0000
committerOscar Fuentes <ofv@wanadoo.es>2011-03-12 16:48:54 +0000
commit879d3a98a2d64793a49e747b3d64020db74c5a3e (patch)
tree3a3e119ec3e7c7602df2b84f812ec1f7203d4164 /cmake
parent798403babdac3bb7e5ad64bc334cc75e697158be (diff)
downloadllvm-879d3a98a2d64793a49e747b3d64020db74c5a3e.tar.gz
llvm-879d3a98a2d64793a49e747b3d64020db74c5a3e.tar.bz2
llvm-879d3a98a2d64793a49e747b3d64020db74c5a3e.tar.xz
Whe we build a shared library, add its list of used libraries to the
link command. Fixed a pair of IF expressions too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127546 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rwxr-xr-xcmake/modules/AddLLVM.cmake5
-rwxr-xr-xcmake/modules/LLVMConfig.cmake4
2 files changed, 7 insertions, 2 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index 764c6591c4..5e0e32acbc 100755
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -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
diff --git a/cmake/modules/LLVMConfig.cmake b/cmake/modules/LLVMConfig.cmake
index e8308f680b..615a118a3c 100755
--- a/cmake/modules/LLVMConfig.cmake
+++ b/cmake/modules/LLVMConfig.cmake
@@ -64,13 +64,13 @@ function(explicit_map_components_to_libraries out_libs)
# Expand some keywords:
list(FIND link_components "engine" engine_required)
- if( engine_required )
+ if( NOT engine_required STREQUAL "-1" )
# TODO: as we assume we are on X86, this is `jit'.
list(APPEND link_components "jit")
list(APPEND link_components "native")
endif()
list(FIND link_components "native" native_required)
- if( native_required )
+ if( NOT native_required STREQUAL "-1" )
list(APPEND link_components "X86")
endif()