[PATCH] D68259: [llvm] [cmake] Store a list of all possible LLVM_DISTRIBUTION_COMPONENTS
Michał Górny via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 1 00:01:38 PDT 2019
mgorny created this revision.
mgorny added reviewers: beanz, tstellar, compnerd.
Herald added a project: LLVM.
Collect all possible LLVM_DISTRIBUTION_COMPONENTS for a given
configuration, and store them in LLVM_ALL_DISTRIBUTION_COMPONENTS cache
variable. This will make it easier for distribution maintainers to
establish the possible options, and to update them on upgrades.
https://reviews.llvm.org/D68259
Files:
llvm/CMakeLists.txt
llvm/cmake/modules/AddLLVM.cmake
llvm/cmake/modules/TableGen.cmake
llvm/docs/BuildingADistribution.rst
Index: llvm/docs/BuildingADistribution.rst
===================================================================
--- llvm/docs/BuildingADistribution.rst
+++ llvm/docs/BuildingADistribution.rst
@@ -176,7 +176,8 @@
This variable can be set to a semi-colon separated list of LLVM build system
components to install. All LLVM-based tools are components, as well as most
of the libraries and runtimes. Component names match the names of the build
- system targets.
+ system targets. The list of currently available components (based on enabled
+ options) can be found in *LLVM_ALL_DISTRIBUTION_COMPONENTS* cache variable.
**LLVM_RUNTIME_DISTRIBUTION_COMPONENTS**:STRING
This variable can be set to a semi-colon separated list of runtime library
Index: llvm/cmake/modules/TableGen.cmake
===================================================================
--- llvm/cmake/modules/TableGen.cmake
+++ llvm/cmake/modules/TableGen.cmake
@@ -151,6 +151,9 @@
endif()
if (${project} STREQUAL LLVM AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS)
+ set(LLVM_ALL_DISTRIBUTION_COMPONENTS "${LLVM_ALL_DISTRIBUTION_COMPONENTS};${target}"
+ CACHE INTERNAL "List of all possible values for LLVM_DISTRIBUTION_COMPONENTS")
+
set(export_to_llvmexports)
if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
NOT LLVM_DISTRIBUTION_COMPONENTS)
Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -700,6 +700,8 @@
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
else()
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)
+ set(LLVM_ALL_DISTRIBUTION_COMPONENTS "${LLVM_ALL_DISTRIBUTION_COMPONENTS};${name}"
+ CACHE INTERNAL "List of all possible values for LLVM_DISTRIBUTION_COMPONENTS")
set(export_to_llvmexports)
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
@@ -912,6 +914,9 @@
if ( ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
if( LLVM_BUILD_TOOLS )
+ set(LLVM_ALL_DISTRIBUTION_COMPONENTS "${LLVM_ALL_DISTRIBUTION_COMPONENTS};${name}"
+ CACHE INTERNAL "List of all possible values for LLVM_DISTRIBUTION_COMPONENTS")
+
set(export_to_llvmexports)
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
NOT LLVM_DISTRIBUTION_COMPONENTS)
@@ -960,6 +965,9 @@
set_target_properties(${name} PROPERTIES FOLDER "Utils")
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS)
+ set(LLVM_ALL_DISTRIBUTION_COMPONENTS "${LLVM_ALL_DISTRIBUTION_COMPONENTS};${name}"
+ CACHE INTERNAL "List of all possible values for LLVM_DISTRIBUTION_COMPONENTS")
+
set(export_to_llvmexports)
if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
NOT LLVM_DISTRIBUTION_COMPONENTS)
Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -883,6 +883,9 @@
# use export_executable_symbols(target).
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
+set(LLVM_ALL_DISTRIBUTION_COMPONENTS ""
+ CACHE INTERNAL "List of all possible values for LLVM_DISTRIBUTION_COMPONENTS")
+
include(AddLLVM)
include(TableGen)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68259.222550.patch
Type: text/x-patch
Size: 3371 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191001/c0316c64/attachment.bin>
More information about the llvm-commits
mailing list