[PATCH] D131310: [llvm-driver] Support single distributions
Alex Brachet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 30 11:40:37 PDT 2022
abrachet updated this revision to Diff 464342.
abrachet edited the summary of this revision.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131310/new/
https://reviews.llvm.org/D131310
Files:
clang/cmake/modules/AddClang.cmake
llvm/cmake/modules/AddLLVM.cmake
llvm/cmake/modules/LLVMDistributionSupport.cmake
Index: llvm/cmake/modules/LLVMDistributionSupport.cmake
===================================================================
--- llvm/cmake/modules/LLVMDistributionSupport.cmake
+++ llvm/cmake/modules/LLVMDistributionSupport.cmake
@@ -244,6 +244,8 @@
set(distributions "<DEFAULT>")
endif()
+ get_property(LLVM_DRIVER_TOOL_SYMLINKS GLOBAL PROPERTY LLVM_DRIVER_TOOL_SYMLINKS)
+
foreach(distribution ${distributions})
if(distribution STREQUAL "<DEFAULT>")
set(distribution_target distribution)
@@ -268,12 +270,16 @@
if(TARGET install-${target})
add_dependencies(install-${distribution_target} install-${target})
+ elseif(TARGET install-llvm-driver AND ${target} IN_LIST LLVM_DRIVER_TOOL_SYMLINKS)
+ add_dependencies(install-${distribution_target} install-llvm-driver)
else()
message(SEND_ERROR "Specified distribution component '${target}' doesn't have an install target")
endif()
if(TARGET install-${target}-stripped)
add_dependencies(install-${distribution_target}-stripped install-${target}-stripped)
+ elseif(TARGET install-llvm-driver-stripped AND ${target} IN_LIST LLVM_DRIVER_TOOL_SYMLINKS)
+ add_dependencies(install-${distribution_target}-stripped install-llvm-driver-stripped)
else()
message(SEND_ERROR
"Specified distribution component '${target}' doesn't have an install-stripped target."
Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -910,7 +910,9 @@
list(APPEND ALL_FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}-driver.cpp)
- if (LLVM_TOOL_LLVM_DRIVER_BUILD)
+ if (LLVM_TOOL_LLVM_DRIVER_BUILD
+ AND (NOT LLVM_DISTRIBUTION_COMPONENTS OR ${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS)
+ )
set_property(GLOBAL APPEND PROPERTY LLVM_DRIVER_COMPONENTS ${LLVM_LINK_COMPONENTS})
set_property(GLOBAL APPEND PROPERTY LLVM_DRIVER_DEPS ${ARG_DEPENDS} ${LLVM_COMMON_DEPENDS})
set_property(GLOBAL APPEND PROPERTY LLVM_DRIVER_OBJLIBS "${obj_name}")
@@ -1301,7 +1303,10 @@
if( NOT LLVM_BUILD_TOOLS )
set(EXCLUDE_FROM_ALL ON)
endif()
- if(ARG_GENERATE_DRIVER AND LLVM_TOOL_LLVM_DRIVER_BUILD)
+ if(ARG_GENERATE_DRIVER
+ AND LLVM_TOOL_LLVM_DRIVER_BUILD
+ AND (NOT LLVM_DISTRIBUTION_COMPONENTS OR ${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS)
+ )
generate_llvm_objects(${name} ${ARGN})
add_custom_target(${name} DEPENDS llvm-driver)
else()
@@ -2032,7 +2037,10 @@
function(llvm_install_symlink project name dest)
get_property(LLVM_DRIVER_TOOLS GLOBAL PROPERTY LLVM_DRIVER_TOOLS)
- if(LLVM_TOOL_LLVM_DRIVER_BUILD AND ${dest} IN_LIST LLVM_DRIVER_TOOLS)
+ if(LLVM_TOOL_LLVM_DRIVER_BUILD
+ AND ${dest} IN_LIST LLVM_DRIVER_TOOLS
+ AND (NOT LLVM_DISTRIBUTION_COMPONENTS OR ${dest} IN_LIST LLVM_DISTRIBUTION_COMPONENTS)
+ )
return()
endif()
cmake_parse_arguments(ARG "ALWAYS_GENERATE" "COMPONENT" "" ${ARGN})
Index: clang/cmake/modules/AddClang.cmake
===================================================================
--- clang/cmake/modules/AddClang.cmake
+++ clang/cmake/modules/AddClang.cmake
@@ -153,7 +153,10 @@
if (NOT CLANG_BUILD_TOOLS)
set(EXCLUDE_FROM_ALL ON)
endif()
- if(ARG_GENERATE_DRIVER AND LLVM_TOOL_LLVM_DRIVER_BUILD)
+ if(ARG_GENERATE_DRIVER
+ AND LLVM_TOOL_LLVM_DRIVER_BUILD
+ AND (NOT LLVM_DISTRIBUTION_COMPONENTS OR ${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS)
+ )
set(get_obj_args ${ARGN})
list(FILTER get_obj_args EXCLUDE REGEX "^SUPPORT_PLUGINS$")
generate_llvm_objects(${name} ${get_obj_args})
@@ -181,7 +184,10 @@
macro(add_clang_symlink name dest)
get_property(LLVM_DRIVER_TOOLS GLOBAL PROPERTY LLVM_DRIVER_TOOLS)
- if(LLVM_TOOL_LLVM_DRIVER_BUILD AND ${dest} IN_LIST LLVM_DRIVER_TOOLS)
+ if(LLVM_TOOL_LLVM_DRIVER_BUILD
+ AND ${dest} IN_LIST LLVM_DRIVER_TOOLS
+ AND (NOT LLVM_DISTRIBUTION_COMPONENTS OR ${dest} IN_LIST LLVM_DISTRIBUTION_COMPONENTS)
+ )
set_property(GLOBAL APPEND PROPERTY LLVM_DRIVER_TOOL_ALIASES_${dest} ${name})
else()
llvm_add_tool_symlink(CLANG ${name} ${dest} ALWAYS_GENERATE)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131310.464342.patch
Type: text/x-patch
Size: 4272 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220930/5485154a/attachment.bin>
More information about the llvm-commits
mailing list