Skip to content

[CMake] Update distribution installation logic - #8785

Open
Chris B (llvm-beanz) wants to merge 1 commit into
microsoft:mainfrom
llvm-beanz:update-installs
Open

[CMake] Update distribution installation logic#8785
Chris B (llvm-beanz) wants to merge 1 commit into
microsoft:mainfrom
llvm-beanz:update-installs

Conversation

@llvm-beanz

Copy link
Copy Markdown
Collaborator

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.

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.
Copilot AI balanced review requested due to automatic review settings August 17, 2026 16:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 for dxv and dxildll.
  • Enable the clang/lib/Headers subdirectory and add install rules/targets for HLSL (and optional SPIR-V/Vulkan) headers.
  • Adjust default install include directory on Windows and expand LLVM_DISTRIBUTION_COMPONENTS to 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 thread CMakeLists.txt
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")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

2 participants