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) 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/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/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