summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2014-02-04 14:42:04 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2014-02-04 14:42:04 +0000
commitc4c93c149307228087f340d52f91a7947b2f6d26 (patch)
treede2a83b228622dbec04a7327df1e517a55d027fc /cmake
parent82adfbd9f94ed6f1dcaf9d67df5514a6b12b41de (diff)
downloadllvm-c4c93c149307228087f340d52f91a7947b2f6d26.tar.gz
llvm-c4c93c149307228087f340d52f91a7947b2f6d26.tar.bz2
llvm-c4c93c149307228087f340d52f91a7947b2f6d26.tar.xz
[CMake] LLVM-Config.cmake: Split explicit_map_components_to_libraries and introduce llvm_map_components_to_libnames and llvm_expand_dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200764 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/LLVM-Config.cmake19
1 files changed, 16 insertions, 3 deletions
diff --git a/cmake/modules/LLVM-Config.cmake b/cmake/modules/LLVM-Config.cmake
index 63f92aea01..ef13ef3364 100644
--- a/cmake/modules/LLVM-Config.cmake
+++ b/cmake/modules/LLVM-Config.cmake
@@ -74,8 +74,8 @@ function(llvm_map_components_to_libraries OUT_VAR)
set( ${OUT_VAR} ${result} ${sys_result} PARENT_SCOPE )
endfunction(llvm_map_components_to_libraries)
-
-function(explicit_map_components_to_libraries out_libs)
+# Map LINK_COMPONENTS to actual libnames.
+function(llvm_map_components_to_libnames out_libs)
set( link_components ${ARGN} )
get_property(llvm_libs GLOBAL PROPERTY LLVM_LIBS)
string(TOUPPER "${llvm_libs}" capitalized_libs)
@@ -157,7 +157,13 @@ function(explicit_map_components_to_libraries out_libs)
endif( lib_idx LESS 0 )
endif( NOT idx LESS 0 )
endforeach(c)
- # Expand dependencies while topologically sorting the list of libraries:
+
+ set(${out_libs} ${expanded_components} PARENT_SCOPE)
+endfunction()
+
+# Expand dependencies while topologically sorting the list of libraries:
+function(llvm_expand_dependencies out_libs)
+ set(expanded_components ${ARGN})
list(LENGTH expanded_components lst_size)
set(cursor 0)
set(processed)
@@ -177,6 +183,13 @@ function(explicit_map_components_to_libraries out_libs)
list(LENGTH processed cursor)
list(LENGTH expanded_components lst_size)
endwhile( cursor LESS lst_size )
+ set(${out_libs} ${expanded_components} PARENT_SCOPE)
+endfunction()
+
+function(explicit_map_components_to_libraries out_libs)
+ llvm_map_components_to_libnames(link_libs ${ARGN})
+ llvm_expand_dependencies(expanded_components ${link_libs})
+ get_property(llvm_libs GLOBAL PROPERTY LLVM_LIBS)
# Return just the libraries included in this build:
set(result)
foreach(c ${expanded_components})