The HLSL support in clang is in progress and not fully functioning. As
such we don't want to install the related optional build components by
default (yet), but we do need an option to build and install them
locally for testing and for some key users.
This adds the `CLANG_ENABLE_HLSL` option which is off by default and can
be enabled to install the HLSL clang headers and the clang-dxc symlink.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D134693
"Generate build targets for the Clang unit tests."
${LLVM_INCLUDE_TESTS})
+option(CLANG_ENABLE_HLSL "Include HLSL build products" Off)
+# While HLSL support is experimental this should stay hidden.
+mark_as_advanced(CLANG_ENABLE_HLSL)
+
add_subdirectory(utils/TableGen)
# Export CLANG_TABLEGEN_EXE for use by flang docs.
# HLSL support is currently limted to clang, eventually it will expand to
# clang-tools-extra too.
set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "")
+
+set(CLANG_ENABLE_HLSL On CACHE BOOL "")
__clang_hip_runtime_wrapper.h
)
-set(hlsl_files
- hlsl.h
+set(hlsl_h hlsl.h)
+set(hlsl_subdir_files
hlsl/hlsl_basic_types.h
hlsl/hlsl_intrinsics.h
)
+set(hlsl_files
+ ${hlsl_h}
+ ${hlsl_subdir_files}
+ )
set(mips_msa_files
msa.h
EXCLUDE_FROM_ALL
COMPONENT x86-resource-headers)
+if(NOT CLANG_ENABLE_HLSL)
+ set(EXCLUDE_HLSL EXCLUDE_FROM_ALL)
+endif()
+
install(
- FILES ${hlsl_files}
+ FILES ${hlsl_h}
DESTINATION ${header_install_dir}
- EXCLUDE_FROM_ALL
+ ${EXCLUDE_HLSL}
+ COMPONENT hlsl-resource-headers)
+
+install(
+ FILES ${hlsl_subdir_files}
+ DESTINATION ${header_install_dir}/hlsl
+ ${EXCLUDE_HLSL}
COMPONENT hlsl-resource-headers)
install(
set(CLANG_LINKS_TO_CREATE clang++ clang-cl clang-cpp)
endif()
-foreach(link ${CLANG_LINKS_TO_CREATE})
+if (CLANG_ENABLE_HLSL)
+ set(HLSL_LINK clang-dxc)
+endif()
+
+foreach(link ${CLANG_LINKS_TO_CREATE} ${HLSL_LINK})
add_clang_symlink(${link} clang)
endforeach()