[CMake] Update distribution installation logic - #8785
Open
Chris B (llvm-beanz) wants to merge 1 commit into
Open
[CMake] Update distribution installation logic#8785Chris B (llvm-beanz) wants to merge 1 commit into
Chris B (llvm-beanz) wants to merge 1 commit into
Conversation
This updates the CMake distribution logic to handle a bunch of additions to our release packages. We still don't actually use this to generate our release packages, but this is a prerequisite step.
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds component-scoped installation targets for several DXC/Clang tools and introduces installable HLSL header sets, aligning install layout (especially on Windows) with existing DXC packages.
Changes:
- Add CMake install components and
install-*custom targets fordxvanddxildll. - Enable the
clang/lib/Headerssubdirectory and add install rules/targets for HLSL (and optional SPIR-V/Vulkan) headers. - Adjust default install include directory on Windows and expand
LLVM_DISTRIBUTION_COMPONENTSto include new components.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/clang/tools/dxv/CMakeLists.txt | Adds dxv install component and a component-only install target. |
| tools/clang/tools/dxildll/CMakeLists.txt | Adds platform-specific install destinations plus component-only install target for dxildll. |
| tools/clang/lib/Headers/CMakeLists.txt | Reworks header installation to add HLSL (and optional Vulkan) headers and install targets. |
| tools/clang/lib/CMakeLists.txt | Enables building the Headers subdirectory. |
| include/dxc/CMakeLists.txt | Installs an additional public header (Support/ErrorCodes.h) as part of dxc-headers. |
| CMakeLists.txt | Sets install include dir (Windows vs non-Windows) and updates distribution components to include new artifacts. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+103
to
+129
| if(SPIENABLE_SPIRV_CODEGENRV) | ||
| set(VK_KHR_HEADERS | ||
| hlsl/vk/khr/cooperative_matrix.h | ||
| hlsl/vk/khr/cooperative_matrix.impl) | ||
|
|
||
| install(FILES ${VK_KHR_HEADERS} | ||
| PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ | ||
| DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hlsl/vk/khr | ||
| COMPONENT hlsl-headers | ||
| ) | ||
|
|
||
| set(out_files) | ||
| foreach( f ${files} ) | ||
| set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} ) | ||
| set( dst ${output_dir}/${f} ) | ||
| add_custom_command(OUTPUT ${dst} | ||
| DEPENDS ${src} | ||
| COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} | ||
| COMMENT "Copying clang's ${f}...") | ||
| list(APPEND out_files ${dst}) | ||
| endforeach( f ) | ||
| set(VK_HEADERS | ||
| hlsl/vk/khr/cooperative_matrix.h | ||
| hlsl/vk/khr/cooperative_matrix.impl | ||
| hlsl/vk/opcode_selector.h | ||
| hlsl/vk/spirv.h | ||
| ) | ||
|
|
||
| install(FILES ${VK_HEADERS} | ||
| PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ | ||
| DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hlsl/vk | ||
| COMPONENT hlsl-headers | ||
| ) | ||
|
|
||
| add_custom_command(OUTPUT ${output_dir}/arm_neon.h | ||
| DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h | ||
| COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h ${output_dir}/arm_neon.h | ||
| COMMENT "Copying clang's arm_neon.h...") | ||
| list(APPEND out_files ${output_dir}/arm_neon.h) | ||
| set(ALL_VK_HEADERS ${VK_KHR_HEADERS} ${VK_HEADERS}) | ||
|
|
||
| add_custom_target(clang-headers ALL DEPENDS ${out_files}) | ||
| set_target_properties(clang-headers PROPERTIES FOLDER "Misc") | ||
| endif(ENABLE_SPIRV_CODEGEN) |
Comment on lines
+104
to
+125
| set(VK_KHR_HEADERS | ||
| hlsl/vk/khr/cooperative_matrix.h | ||
| hlsl/vk/khr/cooperative_matrix.impl) | ||
|
|
||
| install(FILES ${VK_KHR_HEADERS} | ||
| PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ | ||
| DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hlsl/vk/khr | ||
| COMPONENT hlsl-headers | ||
| ) | ||
|
|
||
| set(out_files) | ||
| foreach( f ${files} ) | ||
| set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} ) | ||
| set( dst ${output_dir}/${f} ) | ||
| add_custom_command(OUTPUT ${dst} | ||
| DEPENDS ${src} | ||
| COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} | ||
| COMMENT "Copying clang's ${f}...") | ||
| list(APPEND out_files ${dst}) | ||
| endforeach( f ) | ||
| set(VK_HEADERS | ||
| hlsl/vk/khr/cooperative_matrix.h | ||
| hlsl/vk/khr/cooperative_matrix.impl | ||
| hlsl/vk/opcode_selector.h | ||
| hlsl/vk/spirv.h | ||
| ) | ||
|
|
||
| install(FILES ${VK_HEADERS} | ||
| PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ | ||
| DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hlsl/vk | ||
| COMPONENT hlsl-headers | ||
| ) |
Comment on lines
+72
to
+101
| # set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include) | ||
| # | ||
| # # Generate arm_neon.h | ||
| # clang_tablegen(arm_neon.h -gen-arm-neon | ||
| # SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td) | ||
| # | ||
| # set(out_files) | ||
| # foreach( f ${files} ) | ||
| # set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} ) | ||
| # set( dst ${output_dir}/${f} ) | ||
| # add_custom_command(OUTPUT ${dst} | ||
| # DEPENDS ${src} | ||
| # COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} | ||
| # COMMENT "Copying clang's ${f}...") | ||
| # list(APPEND out_files ${dst}) | ||
| # endforeach( f ) | ||
| # | ||
| # add_custom_command(OUTPUT ${output_dir}/arm_neon.h | ||
| # DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h | ||
| # COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h ${output_dir}/arm_neon.h | ||
| # COMMENT "Copying clang's arm_neon.h...") | ||
| # list(APPEND out_files ${output_dir}/arm_neon.h) | ||
| # | ||
| # add_custom_target(clang-headers ALL DEPENDS ${out_files}) | ||
| # set_target_properties(clang-headers PROPERTIES FOLDER "Misc") | ||
| # | ||
| # install( | ||
| # FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h | ||
| # PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ | ||
| # DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) |
Comment on lines
+102
to
+105
| if(WIN32) | ||
| set(CMAKE_INSTALL_INCLUDEDIR inc) | ||
| else() | ||
| set(CMAKE_INSTALL_INCLUDEDIR include) |
Comment on lines
+88
to
+96
| if (WIN32) | ||
| set(install_dest RUNTIME DESTINATION bin) | ||
| else() | ||
| set(install_dest LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}) | ||
| endif() | ||
|
|
||
| install(TARGETS dxildll | ||
| ${install_dest} | ||
| COMPONENT dxildll) |
Comment on lines
+41
to
+42
| -DCMAKE_INSTALL_COMPONENT=dxv | ||
| -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") |
Comment on lines
+101
to
+102
| -DCMAKE_INSTALL_COMPONENT=dxildll | ||
| -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the CMake distribution logic to handle a bunch of additions to our release packages.
We still don't actually use this to generate our release packages, but this is a prerequisite step.