Skip to content
Snippets Groups Projects
Commit 8a534b03 authored by Chris Bieneman's avatar Chris Bieneman
Browse files

[CMake] Support runtimes in distributions

Summary:
This patch adds a new internal variable
LLVM_RUNTIME_DISTRIBUTION_COMPONENTS which specifies distribution
components that are part of runtime projects, and thus should be exposed
from runtime configuraitons up into the top-level CMake configurations.

This is required for allowing runtime components to be included in
LLVM_DISTRIBUTION_COMPONENTS because we verify that the build and
install targets exist for every component specified for the
distribution.

Without this patch runtimes and builtins can only be included in
distributions in whole, not by component.

Reviewers: phosek

Reviewed By: phosek

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D46705

llvm-svn: 332631
parent 93d45bc7
No related branches found
No related tags found
No related merge requests found
...@@ -998,7 +998,7 @@ if(LLVM_DISTRIBUTION_COMPONENTS) ...@@ -998,7 +998,7 @@ if(LLVM_DISTRIBUTION_COMPONENTS)
add_custom_target(distribution) add_custom_target(distribution)
add_custom_target(install-distribution) add_custom_target(install-distribution)
add_custom_target(install-distribution-stripped) add_custom_target(install-distribution-stripped)
foreach(target ${LLVM_DISTRIBUTION_COMPONENTS}) foreach(target ${LLVM_DISTRIBUTION_COMPONENTS} ${LLVM_RUNTIME_DISTRIBUTION_COMPONENTS})
if(TARGET ${target}) if(TARGET ${target})
add_dependencies(distribution ${target}) add_dependencies(distribution ${target})
else() else()
......
...@@ -352,6 +352,11 @@ else() # if this is included from LLVM's CMake ...@@ -352,6 +352,11 @@ else() # if this is included from LLVM's CMake
list(APPEND test_targets check-${runtime_name}) list(APPEND test_targets check-${runtime_name})
endif() endif()
endforeach() endforeach()
foreach(component ${LLVM_RUNTIME_DISTRIBUTION_COMPONENTS})
if(NOT ${component} IN_LIST SUB_COMPONENTS)
list(APPEND extra_targets ${component} install-${component} install-${component}-stripped)
endif()
endforeach()
if(LLVM_INCLUDE_TESTS) if(LLVM_INCLUDE_TESTS)
list(APPEND test_targets runtimes-test-depends check-runtimes) list(APPEND test_targets runtimes-test-depends check-runtimes)
...@@ -407,6 +412,14 @@ else() # if this is included from LLVM's CMake ...@@ -407,6 +412,14 @@ else() # if this is included from LLVM's CMake
list(APPEND ${name}_extra_targets "${target_name}:${target_name}-${name}") list(APPEND ${name}_extra_targets "${target_name}:${target_name}-${name}")
endforeach() endforeach()
foreach(component ${LLVM_RUNTIME_DISTRIBUTION_COMPONENTS})
if(NOT "${target_name}:${target_name}-${component}" IN_LIST extra_targets)
list(APPEND ${name}_extra_targets
"${target_name}:${target_name}-${component}"
"${target_name}:${target_name}-install-${component}")
endif()
endforeach()
if(LLVM_INCLUDE_TESTS) if(LLVM_INCLUDE_TESTS)
list(APPEND ${name}_test_targets list(APPEND ${name}_test_targets
"runtimes-test-depends:runtimes-test-depends-${name}" "runtimes-test-depends:runtimes-test-depends-${name}"
...@@ -478,6 +491,12 @@ else() # if this is included from LLVM's CMake ...@@ -478,6 +491,12 @@ else() # if this is included from LLVM's CMake
add_custom_target(runtimes-test-depends) add_custom_target(runtimes-test-depends)
set(test_targets "") set(test_targets "")
endif() endif()
if(LLVM_RUNTIME_DISTRIBUTION_COMPONENTS)
foreach(component ${LLVM_RUNTIME_DISTRIBUTION_COMPONENTS})
add_custom_target(${component})
add_custom_target(install-${component})
endforeach()
endif()
endif() endif()
foreach(name ${LLVM_RUNTIME_TARGETS}) foreach(name ${LLVM_RUNTIME_TARGETS})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment