1 option(LLVM_INCLUDE_DXIL_TESTS "Include DXIL tests" Off)
2 mark_as_advanced(LLVM_INCLUDE_DXIL_TESTS)
4 if (NOT LLVM_INCLUDE_DXIL_TESTS)
8 if (NOT "DirectX" IN_LIST LLVM_TARGETS_TO_BUILD)
9 message(FATAL_ERROR "Building dxil-dis tests is unsupported without the DirectX target")
13 set(LLVM_LINK_OR_COPY create_symlink)
15 set(LLVM_LINK_OR_COPY copy)
19 add_custom_target(dxil-dis
20 COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} "${DXIL_DIS}" "${LLVM_RUNTIME_OUTPUT_INTDIR}/dxil-dis${CMAKE_EXECUTABLE_SUFFIX}")
24 include(ExternalProject)
26 set(SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/DXC-src)
27 set(BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/DXC-bins)
29 GIT_REPOSITORY https://github.com/microsoft/DirectXShaderCompiler.git
33 set(SOURCE_DIR ${DXC_SOURCE_DIR})
37 ExternalProject_Add(DXC
39 SOURCE_DIR ${SOURCE_DIR}
40 BINARY_DIR ${BINARY_DIR}
41 CMAKE_ARGS -C ${SOURCE_DIR}/cmake/caches/PredefinedParams.cmake -DLLVM_INCLUDE_TESTS=On
42 BUILD_COMMAND ${CMAKE_COMMAND} --build ${BINARY_DIR} --target llvm-dis
43 BUILD_BYPRODUCTS ${BINARY_DIR}/bin/llvm-dis
47 add_custom_target(dxil-dis
48 COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} "${BINARY_DIR}/bin/llvm-dis${CMAKE_EXECUTABLE_SUFFIX}" "${LLVM_RUNTIME_OUTPUT_INTDIR}/dxil-dis${CMAKE_EXECUTABLE_SUFFIX}"