[PATCH] D37644: [CMake][runtimes] Use list of lists rather than ":" delimiters
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 8 15:37:48 PDT 2017
phosek created this revision.
Herald added a subscriber: mgorny.
This is a more idiomatic CMake.
Repository:
rL LLVM
https://reviews.llvm.org/D37644
Files:
cmake/modules/LLVMExternalProjectUtils.cmake
runtimes/CMakeLists.txt
Index: runtimes/CMakeLists.txt
===================================================================
--- runtimes/CMakeLists.txt
+++ runtimes/CMakeLists.txt
@@ -346,24 +346,26 @@
endif()
foreach(runtime_name ${runtime_names})
- list(APPEND ${name}_extra_targets
- "${runtime_name}:${runtime_name}-${name}"
- "install-${runtime_name}:install-${runtime_name}-${name}")
+ set(${name}_${runtime_name} ${runtime_name} ${runtime_name}-${name})
+ set(${name}_install_${runtime_name} install-${runtime_name} install-${runtime_name}-${name})
+ list(APPEND ${name}_extra_targets ${name}_${runtime_name} ${name}_install_${runtime_name})
if(LLVM_INCLUDE_TESTS)
- list(APPEND ${name}_test_targets "check-${runtime_name}:check-${runtime_name}-${name}")
+ set(${name}_check_${runtime_name} check-${runtime_name} check-${runtime_name}-${name})
+ list(APPEND ${name}_test_targets ${name}_check_${runtime_name})
endif()
endforeach()
foreach(target_name IN LISTS SUB_COMPONENTS SUB_INSTALL_TARGETS)
list(APPEND ${name}_extra_targets "${target_name}:${target_name}-${name}")
endforeach()
if(LLVM_INCLUDE_TESTS)
- list(APPEND ${name}_test_targets
- "runtimes-test-depends:runtimes-test-depends-${name}"
- "check-runtimes:check-runtimes-${name}")
+ set(${name}_runtime_test_depends runtimes-test-depends runtimes-test-depends-${name})
+ set(${name}_check_runtimes check-runtimes check-runtimes-${name})
+ list(APPEND ${name}_test_targets ${name}_runtime_test_depends ${name}_check_runtimes)
foreach(target_name IN LISTS SUB_CHECK_TARGETS)
- list(APPEND ${name}_test_targets "${target_name}:${target_name}-${name}")
+ set(${name}_${target_name} ${target_name} ${target_name}-${name})
+ list(APPEND ${name}_test_targets ${name}_${target_name})
list(APPEND test_targets "${target_name}-${name}")
endforeach()
set(test_targets "${test_targets}" PARENT_SCOPE)
Index: cmake/modules/LLVMExternalProjectUtils.cmake
===================================================================
--- cmake/modules/LLVMExternalProjectUtils.cmake
+++ cmake/modules/LLVMExternalProjectUtils.cmake
@@ -196,11 +196,14 @@
# Add top-level targets
foreach(target ${ARG_EXTRA_TARGETS})
- string(REPLACE ":" ";" target_list ${target})
- list(GET target_list 0 target)
- list(LENGTH target_list target_list_len)
- if(${target_list_len} GREATER 1)
- list(GET target_list 1 target_name)
+ if(DEFINED ${target})
+ list(LENGTH ${target} target_len)
+ if(${target_len} GREATER 1)
+ list(GET ${target} 1 target_name)
+ else()
+ list(GET ${target} 0 target_name)
+ endif()
+ list(GET ${target} 0 target)
else()
set(target_name "${target}")
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37644.114443.patch
Type: text/x-patch
Size: 2866 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170908/63fdce79/attachment.bin>
More information about the llvm-commits
mailing list