Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ mark_as_advanced(DXC_DISABLE_ALLOCATOR_OVERRIDES)
option(DXC_CODEGEN_EXCEPTIONS_TRAP "An exception in code generation generates a trap, ending the compiler process" OFF)
mark_as_advanced(DXC_CODEGEN_EXCEPTIONS_TRAP)

# HLSL Change Begin - Match DXC windows install packages
if(WIN32)
set(CMAKE_INSTALL_INCLUDEDIR inc)
else()
set(CMAKE_INSTALL_INCLUDEDIR include)
Comment on lines +102 to +105
endif()
# HLSL Change End - Match DXC windows install packages

# adjust link option to enable debugging from kernel mode; not compatible with incremental linking
if(NOT CMAKE_VERSION VERSION_LESS "3.13" AND MSVC AND NOT CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64EC")
add_link_options(/DEBUGTYPE:CV,FIXUP,PDATA /INCREMENTAL:NO)
Expand Down Expand Up @@ -805,7 +813,7 @@ endif()
include(CoverageReport)

# HLSL Change begin - Set default distribution value.
set(LLVM_DISTRIBUTION_COMPONENTS "dxc;dxcompiler;dxc-headers" CACHE STRING "")
set(LLVM_DISTRIBUTION_COMPONENTS "dxc;dxv;dxcompiler;dxildll;dxc-headers;hlsl-headers" CACHE STRING "")
# HLSL Change end - Set default distribution value.

# This must be at the end of the LLVM root CMakeLists file because it must run
Expand Down
8 changes: 8 additions & 0 deletions include/dxc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ install(FILES
COMPONENT dxc-headers
)



install(FILES
Support/ErrorCodes.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dxc/Support
COMPONENT dxc-headers
)

add_custom_target(install-dxc-headers
DEPENDS dxc-headers
COMMAND "${CMAKE_COMMAND}"
Expand Down
4 changes: 2 additions & 2 deletions tools/clang/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# add_subdirectory(Headers)
add_subdirectory(Headers)
add_subdirectory(Basic)
add_subdirectory(Lex)
add_subdirectory(Parse)
Expand Down Expand Up @@ -26,4 +26,4 @@ add_subdirectory(Format)
if (ENABLE_SPIRV_CODEGEN)
add_subdirectory(SPIRV)
endif (ENABLE_SPIRV_CODEGEN)
# SPIRV change ends
# SPIRV change ends
109 changes: 84 additions & 25 deletions tools/clang/lib/Headers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,33 +69,92 @@ set(files
xtestintrin.h
)

set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
# 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 +72 to +101

# Generate arm_neon.h
clang_tablegen(arm_neon.h -gen-arm-neon
SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
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
)
Comment on lines +104 to +125

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 +103 to +129

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)
set(DX_HEADERS
hlsl/dx/linalg.h)

install(FILES ${DX_HEADERS}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hlsl/dx
COMPONENT hlsl-headers
)

set(HLSL_HEADERS
hlsl/enable_if
hlsl/type_traits
hlsl/vector_utils
hlsl/LICENSE.txt)

install(FILES ${HLSL_HEADERS}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hlsl
COMPONENT hlsl-headers
)

set(ALL_HLSL_HEADERS ${HLSL_HEADERS} ${DX_HEADERS} ${ALL_VK_HEADERS})

add_custom_target(hlsl-headers ALL DEPENDS ${ALL_HLSL_HEADERS})

add_custom_target(install-hlsl-headers
DEPENDS hlsl-headers
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=hlsl-headers
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
16 changes: 16 additions & 0 deletions tools/clang/tools/dxildll/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,19 @@ set_target_properties(dxildll
PROPERTIES
OUTPUT_NAME "dxil"
)

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 +88 to +96

add_custom_target(install-dxildll
DEPENDS dxildll
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=dxildll
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
Comment on lines +101 to +102
10 changes: 8 additions & 2 deletions tools/clang/tools/dxv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,11 @@ else()
endif()

install(TARGETS dxv
RUNTIME DESTINATION bin)

RUNTIME DESTINATION bin
COMPONENT dxv)

add_custom_target(install-dxv
DEPENDS dxv
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=dxv
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
Comment on lines +41 to +42
Loading