llvm.org GIT mirror llvm / 2e1513d
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136543 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 8 years ago
4 changed file(s) with 18 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
3636 macro(add_llvm_library_dependencies name)
3737 # Save the dependencies of the LLVM library in a variable so that we can
3838 # query it when resolve llvm-config-style component -> library mappings.
39 set(LLVM_LIB_DEPS_${name} ${ARGN})
39 set_property(GLOBAL PROPERTY LLVM_LIB_DEPS_${name} ${ARGN})
4040
4141 # Then add the actual dependencies to the library target.
4242 target_link_libraries(${name} ${ARGN})
11 set(LLVM_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
22
33 get_property(llvm_libs GLOBAL PROPERTY LLVM_LIBS)
4
5 foreach(lib ${llvm_libs})
6 get_property(llvm_lib_deps GLOBAL PROPERTY LLVM_LIB_DEPS_${lib})
7 set(all_llvm_lib_deps
8 "${all_llvm_lib_deps}\nset_property(GLOBAL PROPERTY LLVM_LIB_DEPS_${lib} ${llvm_lib_deps})")
9 endforeach(lib)
410
511 configure_file(
612 LLVMConfig.cmake.in
134134 string(TOUPPER "${c}" capitalized)
135135 list(FIND capitalized_libs LLVM${capitalized} lib_idx)
136136 if( lib_idx LESS 0 )
137 # The component is unknown. Maybe is an omitted target?
138 is_llvm_target_library(${c} iltl_result)
139 if( NOT iltl_result )
140 message(FATAL_ERROR "Library `${c}' not found in list of llvm libraries.")
141 endif()
137 # The component is unknown. Maybe is an omitted target?
138 is_llvm_target_library(${c} iltl_result)
139 if( NOT iltl_result )
140 message(FATAL_ERROR "Library `${c}' not found in list of llvm libraries.")
141 endif()
142142 else( lib_idx LESS 0 )
143 list(GET llvm_libs ${lib_idx} canonical_lib)
144 list(APPEND expanded_components ${canonical_lib})
143 list(GET llvm_libs ${lib_idx} canonical_lib)
144 list(APPEND expanded_components ${canonical_lib})
145145 endif( lib_idx LESS 0 )
146146 endif( NOT idx LESS 0 )
147147 endforeach(c)
151151 set(processed)
152152 while( cursor LESS lst_size )
153153 list(GET expanded_components ${cursor} lib)
154 list(APPEND expanded_components ${LLVM_LIB_DEPS_${lib}})
154 get_property(lib_deps GLOBAL PROPERTY LLVM_LIB_DEPS_${lib})
155 list(APPEND expanded_components ${lib_deps})
155156 # Remove duplicates at the front:
156157 list(REVERSE expanded_components)
157158 list(REMOVE_DUPLICATES expanded_components)
1010 set(LLVM_TARGETS_TO_BUILD @LLVM_TARGETS_TO_BUILD@)
1111
1212 set(LLVM_TARGETS_WITH_JIT @LLVM_TARGETS_WITH_JIT@)
13
14 @all_llvm_lib_deps@
1315
1416 set(TARGET_TRIPLE "@TARGET_TRIPLE@")
1517