[llvm-commits] [llvm] r136543 - in /llvm/trunk/cmake/modules: AddLLVM.cmake CMakeLists.txt LLVM-Config.cmake LLVMConfig.cmake.in
Chandler Carruth
chandlerc at gmail.com
Fri Jul 29 16:52:01 PDT 2011
Author: chandlerc
Date: Fri Jul 29 18:52:01 2011
New Revision: 136543
URL: http://llvm.org/viewvc/llvm-project?rev=136543&view=rev
Log:
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.
Modified:
llvm/trunk/cmake/modules/AddLLVM.cmake
llvm/trunk/cmake/modules/CMakeLists.txt
llvm/trunk/cmake/modules/LLVM-Config.cmake
llvm/trunk/cmake/modules/LLVMConfig.cmake.in
Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=136543&r1=136542&r2=136543&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Fri Jul 29 18:52:01 2011
@@ -37,7 +37,7 @@
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})
Modified: llvm/trunk/cmake/modules/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/CMakeLists.txt?rev=136543&r1=136542&r2=136543&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/CMakeLists.txt (original)
+++ llvm/trunk/cmake/modules/CMakeLists.txt Fri Jul 29 18:52:01 2011
@@ -3,6 +3,12 @@
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
Modified: llvm/trunk/cmake/modules/LLVM-Config.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVM-Config.cmake?rev=136543&r1=136542&r2=136543&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVM-Config.cmake (original)
+++ llvm/trunk/cmake/modules/LLVM-Config.cmake Fri Jul 29 18:52:01 2011
@@ -135,14 +135,14 @@
string(TOUPPER "${c}" capitalized)
list(FIND capitalized_libs LLVM${capitalized} lib_idx)
if( lib_idx LESS 0 )
- # The component is unknown. Maybe is an omitted target?
- is_llvm_target_library(${c} iltl_result)
- if( NOT iltl_result )
- message(FATAL_ERROR "Library `${c}' not found in list of llvm libraries.")
- endif()
+ # The component is unknown. Maybe is an omitted target?
+ is_llvm_target_library(${c} iltl_result)
+ if( NOT iltl_result )
+ message(FATAL_ERROR "Library `${c}' not found in list of llvm libraries.")
+ endif()
else( lib_idx LESS 0 )
- list(GET llvm_libs ${lib_idx} canonical_lib)
- list(APPEND expanded_components ${canonical_lib})
+ list(GET llvm_libs ${lib_idx} canonical_lib)
+ list(APPEND expanded_components ${canonical_lib})
endif( lib_idx LESS 0 )
endif( NOT idx LESS 0 )
endforeach(c)
@@ -152,7 +152,8 @@
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)
Modified: llvm/trunk/cmake/modules/LLVMConfig.cmake.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMConfig.cmake.in?rev=136543&r1=136542&r2=136543&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVMConfig.cmake.in (original)
+++ llvm/trunk/cmake/modules/LLVMConfig.cmake.in Fri Jul 29 18:52:01 2011
@@ -12,6 +12,8 @@
set(LLVM_TARGETS_WITH_JIT @LLVM_TARGETS_WITH_JIT@)
+ at all_llvm_lib_deps@
+
set(TARGET_TRIPLE "@TARGET_TRIPLE@")
set(LLVM_TOOLS_BINARY_DIR @LLVM_TOOLS_BINARY_DIR@)
More information about the llvm-commits
mailing list