1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

Make my attempt to build up global deps variables actually utilize

globally scoped constructs. Also, round-trip these dependencies through
the LLVMConfig.cmake.in file thata is used by CMake-based clients of
"installed" (or built) LLVM trees.

llvm-svn: 136543
This commit is contained in:
Chandler Carruth 2011-07-29 23:52:01 +00:00
parent a05b70241c
commit c1b18f5265
4 changed files with 18 additions and 9 deletions

View File

@ -37,7 +37,7 @@ endmacro(add_llvm_library name)
macro(add_llvm_library_dependencies name)
# Save the dependencies of the LLVM library in a variable so that we can
# query it when resolve llvm-config-style component -> library mappings.
set(LLVM_LIB_DEPS_${name} ${ARGN})
set_property(GLOBAL PROPERTY LLVM_LIB_DEPS_${name} ${ARGN})
# Then add the actual dependencies to the library target.
target_link_libraries(${name} ${ARGN})

View File

@ -3,6 +3,12 @@ set(LLVM_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
get_property(llvm_libs GLOBAL PROPERTY LLVM_LIBS)
foreach(lib ${llvm_libs})
get_property(llvm_lib_deps GLOBAL PROPERTY LLVM_LIB_DEPS_${lib})
set(all_llvm_lib_deps
"${all_llvm_lib_deps}\nset_property(GLOBAL PROPERTY LLVM_LIB_DEPS_${lib} ${llvm_lib_deps})")
endforeach(lib)
configure_file(
LLVMConfig.cmake.in
${llvm_cmake_builddir}/LLVMConfig.cmake

View File

@ -152,7 +152,8 @@ function(explicit_map_components_to_libraries out_libs)
set(processed)
while( cursor LESS lst_size )
list(GET expanded_components ${cursor} lib)
list(APPEND expanded_components ${LLVM_LIB_DEPS_${lib}})
get_property(lib_deps GLOBAL PROPERTY LLVM_LIB_DEPS_${lib})
list(APPEND expanded_components ${lib_deps})
# Remove duplicates at the front:
list(REVERSE expanded_components)
list(REMOVE_DUPLICATES expanded_components)

View File

@ -12,6 +12,8 @@ set(LLVM_TARGETS_TO_BUILD @LLVM_TARGETS_TO_BUILD@)
set(LLVM_TARGETS_WITH_JIT @LLVM_TARGETS_WITH_JIT@)
@all_llvm_lib_deps@
set(TARGET_TRIPLE "@TARGET_TRIPLE@")
set(LLVM_TOOLS_BINARY_DIR @LLVM_TOOLS_BINARY_DIR@)