Skip to content

Commit

Permalink
Whe we build a shared library, add its list of used libraries to the
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Oscar Fuentes committed Mar 12, 2011
1 parent 798403b commit 879d3a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions cmake/modules/AddLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/LLVMConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 879d3a9

Please sign in to comment.