Index: cmake/modules/LLVMExternalProjectUtils.cmake =================================================================== --- cmake/modules/LLVMExternalProjectUtils.cmake +++ cmake/modules/LLVMExternalProjectUtils.cmake @@ -201,16 +201,13 @@ # 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}) + set(target_name "${${target}}") else() set(target_name "${target}") endif() - llvm_ExternalProject_BuildCmd(build_runtime_cmd ${target} ${BINARY_DIR}) - add_custom_target(${target_name} + llvm_ExternalProject_BuildCmd(build_runtime_cmd ${target_name} ${BINARY_DIR}) + add_custom_target(${target} COMMAND ${build_runtime_cmd} DEPENDS ${name}-configure WORKING_DIRECTORY ${BINARY_DIR} Index: runtimes/CMakeLists.txt =================================================================== --- runtimes/CMakeLists.txt +++ runtimes/CMakeLists.txt @@ -381,26 +381,29 @@ endif() foreach(runtime_name ${runtime_names}) - list(APPEND ${name}_extra_targets - "${runtime_name}:${runtime_name}-${name}" - "install-${runtime_name}:install-${runtime_name}-${name}" - "install-${runtime_name}-stripped:install-${runtime_name}-${name}-stripped") + set(${runtime_name}-${name} ${runtime_name}) + set(install-${runtime_name}-${name} install-${runtime_name}) + set(install-${runtime_name}-${name}-stripped install-${runtime_name}-stripped) + list(APPEND ${name}_extra_targets ${runtime_name}-${name} install-${runtime_name}-${name} install-${runtime_name}-${name}-stripped) if(LLVM_INCLUDE_TESTS) - list(APPEND ${name}_test_targets "check-${runtime_name}:check-${runtime_name}-${name}") + set(check-${runtime_name}-${name} check-${runtime_name} ) + list(APPEND ${name}_test_targets check-${runtime_name}-${name}) endif() endforeach() foreach(target_name IN LISTS SUB_COMPONENTS SUB_INSTALL_TARGETS) - list(APPEND ${name}_extra_targets "${target_name}:${target_name}-${name}") + set(${target_name}-${name} ${target_name}) + list(APPEND ${name}_extra_targets ${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(runtimes-test-depends-${name} runtimes-test-depends) + set(check-runtimes-${name} check-runtimes) + list(APPEND ${name}_test_targets runtimes-test-depends-${name} check-runtimes-${name}) foreach(target_name IN LISTS SUB_CHECK_TARGETS) - list(APPEND ${name}_test_targets "${target_name}:${target_name}-${name}") - list(APPEND test_targets "${target_name}-${name}") + set(${target_name}-${name} ${target_name}) + list(APPEND ${name}_test_targets ${target_name}-${name}) + list(APPEND test_targets ${target_name}-${name}) endforeach() set(test_targets "${test_targets}" PARENT_SCOPE) endif()