Ryan Harrison | e87ac76 | 2022-04-06 15:37:27 -0400 | [diff] [blame] | 1 | # Copyright 2022 The Dawn & Tint Authors |
Corentin Wallez | 7fe6efb | 2020-02-05 17:16:05 +0000 | [diff] [blame] | 2 | # |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 3 | # Redistribution and use in source and binary forms, with or without |
| 4 | # modification, are permitted provided that the following conditions are met: |
Corentin Wallez | 7fe6efb | 2020-02-05 17:16:05 +0000 | [diff] [blame] | 5 | # |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 6 | # 1. Redistributions of source code must retain the above copyright notice, this |
| 7 | # list of conditions and the following disclaimer. |
Corentin Wallez | 7fe6efb | 2020-02-05 17:16:05 +0000 | [diff] [blame] | 8 | # |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 9 | # 2. Redistributions in binary form must reproduce the above copyright notice, |
| 10 | # this list of conditions and the following disclaimer in the documentation |
| 11 | # and/or other materials provided with the distribution. |
| 12 | # |
| 13 | # 3. Neither the name of the copyright holder nor the names of its |
| 14 | # contributors may be used to endorse or promote products derived from |
| 15 | # this software without specific prior written permission. |
| 16 | # |
| 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 20 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| 21 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 22 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 23 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 24 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 25 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Corentin Wallez | 7fe6efb | 2020-02-05 17:16:05 +0000 | [diff] [blame] | 27 | |
Aleksi Sapon | 9a10674 | 2021-09-28 16:48:01 +0000 | [diff] [blame] | 28 | # Don't build testing in third_party dependencies |
| 29 | set(BUILD_TESTING OFF) |
| 30 | |
Elie Michel | 9ae8ed2 | 2023-05-12 20:19:41 +0000 | [diff] [blame] | 31 | # fetch_dawn_dependencies.py is an alternative to using depot_tools |
| 32 | # It is particularly interesting when building dawn as a subdirectory in |
| 33 | # a parent project that does not want to use depot_tools. |
| 34 | if (${DAWN_FETCH_DEPENDENCIES}) |
| 35 | find_package(PythonInterp 3 REQUIRED) |
| 36 | |
| 37 | set(EXTRA_FETCH_ARGS) |
| 38 | if (NOT TARGET gmock AND ${TINT_BUILD_TESTS}) |
| 39 | list(APPEND EXTRA_FETCH_ARGS --use-test-deps) |
| 40 | endif() |
| 41 | |
| 42 | message(STATUS "Running fetch_dawn_dependencies:") |
| 43 | execute_process( |
| 44 | COMMAND |
| 45 | ${PYTHON_EXECUTABLE} |
| 46 | "${PROJECT_SOURCE_DIR}/tools/fetch_dawn_dependencies.py" |
| 47 | --directory ${PROJECT_SOURCE_DIR} |
| 48 | ${EXTRA_FETCH_ARGS} |
| 49 | ) |
| 50 | endif () |
| 51 | |
Corentin Wallez | 7fe6efb | 2020-02-05 17:16:05 +0000 | [diff] [blame] | 52 | if (NOT TARGET SPIRV-Headers) |
Corentin Wallez | 42450c6 | 2020-04-10 17:04:31 +0000 | [diff] [blame] | 53 | set(SPIRV_HEADERS_SKIP_EXAMPLES ON CACHE BOOL "" FORCE) |
| 54 | set(SPIRV_HEADERS_SKIP_INSTALL ON CACHE BOOL "" FORCE) |
Corentin Wallez | 7fe6efb | 2020-02-05 17:16:05 +0000 | [diff] [blame] | 55 | |
| 56 | message(STATUS "Dawn: using SPIRV-Headers at ${DAWN_SPIRV_HEADERS_DIR}") |
Aleksi Sapon | 9a10674 | 2021-09-28 16:48:01 +0000 | [diff] [blame] | 57 | add_subdirectory(${DAWN_SPIRV_HEADERS_DIR} "${CMAKE_CURRENT_BINARY_DIR}/spirv-headers") |
Corentin Wallez | 7fe6efb | 2020-02-05 17:16:05 +0000 | [diff] [blame] | 58 | endif() |
| 59 | |
| 60 | if (NOT TARGET SPIRV-Tools) |
Corentin Wallez | 42450c6 | 2020-04-10 17:04:31 +0000 | [diff] [blame] | 61 | set(SPIRV_SKIP_TESTS ON CACHE BOOL "" FORCE) |
| 62 | set(SPIRV_SKIP_EXECUTABLES ON CACHE BOOL "" FORCE) |
| 63 | set(SKIP_SPIRV_TOOLS_INSTALL ON CACHE BOOL "" FORCE) |
Corentin Wallez | 7fe6efb | 2020-02-05 17:16:05 +0000 | [diff] [blame] | 64 | |
Ryan Harrison | e87ac76 | 2022-04-06 15:37:27 -0400 | [diff] [blame] | 65 | if(${TINT_BUILD_SPV_READER} OR ${TINT_BUILD_SPV_WRITER}) |
Corentin Wallez | f9f1c4b | 2022-05-16 09:11:21 +0000 | [diff] [blame] | 66 | set(SPIRV_SKIP_TESTS ON CACHE BOOL "Controls whether SPIR-V tests are run" FORCE) |
| 67 | set(SPIRV_WERROR OFF CACHE BOOL OFF FORCE) |
| 68 | if (${TINT_BUILD_SPIRV_TOOLS_FUZZER}) |
| 69 | set(SPIRV_BUILD_FUZZER ON CACHE BOOL "Controls whether spirv-fuzz is built" FORCE) |
| 70 | endif() |
Ryan Harrison | e87ac76 | 2022-04-06 15:37:27 -0400 | [diff] [blame] | 71 | endif() |
| 72 | |
Corentin Wallez | 7fe6efb | 2020-02-05 17:16:05 +0000 | [diff] [blame] | 73 | message(STATUS "Dawn: using SPIRV-Tools at ${DAWN_SPIRV_TOOLS_DIR}") |
Ryan Harrison | e87ac76 | 2022-04-06 15:37:27 -0400 | [diff] [blame] | 74 | add_subdirectory(${DAWN_SPIRV_TOOLS_DIR} "${CMAKE_CURRENT_BINARY_DIR}/spirv-tools" EXCLUDE_FROM_ALL) |
Corentin Wallez | 7fe6efb | 2020-02-05 17:16:05 +0000 | [diff] [blame] | 75 | endif() |
| 76 | |
Antonio Maiorano | 4759145 | 2023-10-19 16:09:04 +0000 | [diff] [blame] | 77 | if(NOT TARGET glslang AND (${TINT_BUILD_GLSL_WRITER} OR ${TINT_BUILD_GLSL_VALIDATOR}) AND ${TINT_BUILD_CMD_TOOLS}) |
Corentin Wallez | f9f1c4b | 2022-05-16 09:11:21 +0000 | [diff] [blame] | 78 | set(SKIP_GLSLANG_INSTALL ON CACHE BOOL "" FORCE) |
| 79 | add_subdirectory("${DAWN_THIRD_PARTY_DIR}/vulkan-deps/glslang/src" "${CMAKE_CURRENT_BINARY_DIR}/glslang" EXCLUDE_FROM_ALL) |
| 80 | endif() |
| 81 | |
Erin Melucci | 38b58e4 | 2023-06-14 16:45:33 +0000 | [diff] [blame] | 82 | if (NOT TARGET glfw AND DAWN_USE_GLFW) |
Ben Clayton | 0ecd67a | 2021-09-23 20:13:53 +0000 | [diff] [blame] | 83 | set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) |
| 84 | set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) |
| 85 | set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) |
Corentin Wallez | 978bc12 | 2023-05-15 13:01:16 +0000 | [diff] [blame] | 86 | set(GLFW_BUILD_X11 ${DAWN_USE_X11} CACHE BOOL "" FORCE) |
| 87 | set(GLFW_BUILD_WAYLAND ${DAWN_USE_WAYLAND} CACHE BOOL "" FORCE) |
Ben Clayton | 0ecd67a | 2021-09-23 20:13:53 +0000 | [diff] [blame] | 88 | |
| 89 | message(STATUS "Dawn: using GLFW at ${DAWN_GLFW_DIR}") |
Aleksi Sapon | 9a10674 | 2021-09-28 16:48:01 +0000 | [diff] [blame] | 90 | add_subdirectory(${DAWN_GLFW_DIR} "${CMAKE_CURRENT_BINARY_DIR}/glfw") |
Ben Clayton | 0ecd67a | 2021-09-23 20:13:53 +0000 | [diff] [blame] | 91 | endif() |
| 92 | |
Brandon Jones | a04663c | 2021-09-23 20:36:03 +0000 | [diff] [blame] | 93 | if (NOT TARGET libabsl) |
| 94 | message(STATUS "Dawn: using Abseil at ${DAWN_ABSEIL_DIR}") |
dan sinclair | cf2456b | 2023-01-07 23:09:14 +0000 | [diff] [blame] | 95 | if (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR |
| 96 | ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")) |
| 97 | add_compile_options( |
| 98 | -Wno-array-parameter |
| 99 | -Wno-deprecated-builtins |
| 100 | -Wno-unknown-warning-option |
| 101 | ) |
| 102 | endif() |
| 103 | |
Aleksi Sapon | 9a10674 | 2021-09-28 16:48:01 +0000 | [diff] [blame] | 104 | add_subdirectory(${DAWN_ABSEIL_DIR} "${CMAKE_CURRENT_BINARY_DIR}/abseil") |
Brandon Jones | a04663c | 2021-09-23 20:36:03 +0000 | [diff] [blame] | 105 | endif() |
| 106 | |
Loko Kung | c96ef43 | 2022-04-02 03:02:40 +0000 | [diff] [blame] | 107 | if (NOT TARGET Vulkan-Headers) |
| 108 | message(STATUS "Dawn: using Vulkan-Headers at ${DAWN_VULKAN_HEADERS_DIR}") |
| 109 | add_subdirectory(${DAWN_VULKAN_HEADERS_DIR} "${CMAKE_CURRENT_BINARY_DIR}/vulkan-headers") |
| 110 | endif() |
| 111 | |
Corentin Wallez | 215b537 | 2020-02-15 00:39:13 +0000 | [diff] [blame] | 112 | # Header-only library for khrplatform.h |
| 113 | add_library(dawn_khronos_platform INTERFACE) |
Antonio Maiorano | 83bdc7f | 2023-08-21 15:29:35 +0000 | [diff] [blame] | 114 | target_sources(dawn_khronos_platform INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/khronos/EGL-Registry/api/KHR/khrplatform.h") |
| 115 | target_include_directories(dawn_khronos_platform INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/khronos/EGL-Registry/api") |
Ryan Harrison | e87ac76 | 2022-04-06 15:37:27 -0400 | [diff] [blame] | 116 | |
| 117 | # Header-only library for Vulkan headers |
| 118 | add_library(dawn_vulkan_headers INTERFACE) |
| 119 | target_sources(dawn_vulkan_headers INTERFACE |
| 120 | "${CMAKE_CURRENT_SOURCE_DIR}/khronos/vulkan/vk_icd.h" |
| 121 | "${CMAKE_CURRENT_SOURCE_DIR}/khronos/vulkan/vk_layer.h" |
| 122 | "${CMAKE_CURRENT_SOURCE_DIR}/khronos/vulkan/vk_platform.h" |
| 123 | "${CMAKE_CURRENT_SOURCE_DIR}/khronos/vulkan/vk_sdk_platform.h" |
| 124 | "${CMAKE_CURRENT_SOURCE_DIR}/khronos/vulkan/vulkan.h" |
| 125 | "${CMAKE_CURRENT_SOURCE_DIR}/khronos/vulkan/vulkan_core.h" |
| 126 | ) |
| 127 | target_include_directories(dawn_vulkan_headers INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/khronos") |
| 128 | |
Corentin Wallez | f9f1c4b | 2022-05-16 09:11:21 +0000 | [diff] [blame] | 129 | if (NOT TARGET vk_swiftshader AND ${DAWN_ENABLE_SWIFTSHADER}) |
Corentin Wallez | be352ea | 2022-04-11 16:48:43 +0000 | [diff] [blame] | 130 | set(SWIFTSHADER_BUILD_TESTS OFF CACHE BOOL "" FORCE) |
| 131 | set(SWIFTSHADER_BUILD_BENCHMARKS OFF CACHE BOOL "" FORCE) |
| 132 | |
| 133 | message(STATUS "Dawn: using Swiftshader at ${DAWN_SWIFTSHADER_DIR}") |
| 134 | add_subdirectory(${DAWN_SWIFTSHADER_DIR} "${CMAKE_CURRENT_BINARY_DIR}/swiftshader") |
| 135 | endif() |
| 136 | |
Austin Eng | 6a7bba5 | 2023-04-17 18:11:51 +0000 | [diff] [blame] | 137 | if (${TINT_BUILD_BENCHMARKS} OR ${DAWN_BUILD_BENCHMARKS}) |
Corentin Wallez | f9f1c4b | 2022-05-16 09:11:21 +0000 | [diff] [blame] | 138 | set(BENCHMARK_ENABLE_TESTING FALSE CACHE BOOL FALSE FORCE) |
Austin Eng | 6a7bba5 | 2023-04-17 18:11:51 +0000 | [diff] [blame] | 139 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/google_benchmark/src EXCLUDE_FROM_ALL) |
Ben Clayton | be2362b | 2022-01-18 18:58:16 +0000 | [diff] [blame] | 140 | endif() |
| 141 | |
Corentin Wallez | f9f1c4b | 2022-05-16 09:11:21 +0000 | [diff] [blame] | 142 | if (NOT TARGET gmock AND ${TINT_BUILD_TESTS}) |
| 143 | set(gtest_force_shared_crt ON CACHE BOOL "Controls whether a shared run-time library should be used even when Google Test is built as static library" FORCE) |
| 144 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/googletest EXCLUDE_FROM_ALL) |
David Neto | 5b46d71 | 2020-06-26 22:29:27 +0000 | [diff] [blame] | 145 | endif() |
Antonio Maiorano | c69356e | 2023-11-23 18:04:51 +0000 | [diff] [blame] | 146 | |
| 147 | function(AddSubdirectoryDXC) |
| 148 | # We use a CMake function so that all these (non-cache) variables are scoped |
| 149 | # only to this function. |
| 150 | set(HLSL_OPTIONAL_PROJS_IN_DEFAULT OFF) |
| 151 | set(HLSL_ENABLE_ANALYZE OFF) |
| 152 | set(HLSL_OFFICIAL_BUILD OFF) |
| 153 | set(HLSL_ENABLE_FIXED_VER OFF) |
| 154 | set(HLSL_BUILD_DXILCONV OFF) |
| 155 | set(HLSL_INCLUDE_TESTS OFF) |
| 156 | |
| 157 | set(ENABLE_SPIRV_CODEGEN OFF) |
| 158 | set(SPIRV_BUILD_TESTS OFF) |
| 159 | |
| 160 | set(LLVM_BUILD_RUNTIME ON) |
| 161 | set(LLVM_BUILD_EXAMPLES OFF) |
| 162 | set(LLVM_BUILD_TESTS OFF) |
| 163 | set(LLVM_INCLUDE_TESTS OFF) |
| 164 | set(LLVM_INCLUDE_DOCS OFF) |
| 165 | set(LLVM_INCLUDE_EXAMPLES OFF) |
| 166 | set(LLVM_OPTIMIZED_TABLEGEN OFF) |
| 167 | set(LLVM_APPEND_VC_REV OFF) |
| 168 | # Enable exception handling (requires RTTI) |
| 169 | set(LLVM_ENABLE_RTTI ON) |
| 170 | set(LLVM_ENABLE_EH ON) |
| 171 | set(CLANG_CL OFF) |
| 172 | |
| 173 | # Cache variables -- these are *not* scoped to this function |
| 174 | set(LLVM_TARGETS_TO_BUILD "None" CACHE STRING "" FORCE) |
| 175 | set(LLVM_DEFAULT_TARGET_TRIPLE "dxil-ms-dx" CACHE STRING "" FORCE) |
| 176 | set(CLANG_ENABLE_STATIC_ANALYZER OFF CACHE BOOL "" FORCE) |
| 177 | set(CLANG_ENABLE_ARCMT OFF CACHE BOOL "" FORCE) |
| 178 | set(CLANG_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) |
| 179 | set(CLANG_INCLUDE_TESTS OFF CACHE BOOL "" FORCE) |
| 180 | |
Antonio Maiorano | 76d8219 | 2024-01-25 17:45:32 +0000 | [diff] [blame] | 181 | if (NOT WIN32) |
| 182 | set(DIRECTX_HEADER_INCLUDE_DIR "${DAWN_THIRD_PARTY_DIR}/dxheaders/include") |
| 183 | endif() |
Antonio Maiorano | c69356e | 2023-11-23 18:04:51 +0000 | [diff] [blame] | 184 | |
| 185 | # Disable HCT.cmake looking for and using clang-format. This is used to compare generated files |
| 186 | # against the copy that is committed to the repo, but fails because the DXC .clangformat file is |
| 187 | # not visible from our build dir. We don't need this validation, so just disable it. |
| 188 | set(CLANG_FORMAT_EXE "" CACHE STRING "" FORCE) |
| 189 | |
| 190 | # DXC sometimes asserts on valid HLSL, so disable all assertions. |
| 191 | set(LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "" FORCE) |
| 192 | |
| 193 | # Override RPATH so that it points to current dir (exe path). This allows both executable and |
| 194 | # shared library to be in the same location, which we set below. Note that DXC places places |
| 195 | # executables in a bin directory, and shared libraries in a lib directory. |
| 196 | if (APPLE) |
| 197 | set(CMAKE_INSTALL_NAME_DIR "@rpath") |
| 198 | set(CMAKE_INSTALL_RPATH "@executable_path") |
| 199 | else() |
| 200 | set(CMAKE_INSTALL_RPATH "\$ORIGIN") |
| 201 | endif() |
| 202 | |
| 203 | message(STATUS "\nAdding DXC to build:\n") |
| 204 | add_subdirectory(dxc |
| 205 | # Disable all targets by default, and enable only the dxc and dxcompiler targets (below) |
| 206 | EXCLUDE_FROM_ALL |
| 207 | ) |
| 208 | set_target_properties(dxc PROPERTIES EXCLUDE_FROM_ALL FALSE) |
| 209 | set_target_properties(dxcompiler PROPERTIES EXCLUDE_FROM_ALL FALSE) |
| 210 | |
| 211 | # Override output dir for both targets so that they end up in the same place |
| 212 | # as the rest of our binaries. Otherwise, DXC wants its outputs in bin and lib dirs. |
| 213 | get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) |
| 214 | if (isMultiConfig) |
| 215 | set_target_properties(dxc dxcompiler PROPERTIES |
| 216 | "RUNTIME_OUTPUT_DIRECTORY_DEBUG" "${CMAKE_BINARY_DIR}/$<CONFIG>" |
| 217 | "RUNTIME_OUTPUT_DIRECTORY_RELEASE" "${CMAKE_BINARY_DIR}/$<CONFIG>" |
| 218 | "LIBRARY_OUTPUT_DIRECTORY_DEBUG" "${CMAKE_BINARY_DIR}/$<CONFIG>" |
| 219 | "LIBRARY_OUTPUT_DIRECTORY_RELEASE" "${CMAKE_BINARY_DIR}/$<CONFIG>" |
| 220 | ) |
| 221 | else() |
| 222 | set_target_properties(dxc dxcompiler PROPERTIES |
| 223 | "RUNTIME_OUTPUT_DIRECTORY" "${CMAKE_BINARY_DIR}" |
| 224 | "LIBRARY_OUTPUT_DIRECTORY" "${CMAKE_BINARY_DIR}" |
| 225 | ) |
| 226 | endif() |
| 227 | |
| 228 | # Create a target that copies dxil.dll from the platform SDK |
Antonio Maiorano | c69356e | 2023-11-23 18:04:51 +0000 | [diff] [blame] | 229 | if (WIN32) |
Antonio Maiorano | 01c4a65 | 2024-03-13 19:38:13 +0000 | [diff] [blame] | 230 | if(DEFINED ENV{WINDOWSSDKDIR}) |
| 231 | # If WINDOWSSDKDIR env var is defined, use its value. This is defined, for example, when |
| 232 | # using a Visual Studio command prompt. |
| 233 | set(WIN10_SDK_PATH "$ENV{WINDOWSSDKDIR}") |
| 234 | else() |
| 235 | # There's no easy way to get the Windows SDK path in CMake; however, conveniently, DXC |
| 236 | # contains a FindD3D12.cmake file that returns WIN10_SDK_PATH and WIN10_SDK_VERSION, |
| 237 | # so let's use that. |
| 238 | # TODO(crbug.com/tint/2106): Get the Win10 SDK path and version ourselves until |
| 239 | # dxc/cmake/modules/FindD3D12.cmake supports non-VS generators. |
| 240 | get_filename_component(WIN10_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE CACHE) |
| 241 | endif() |
| 242 | |
Antonio Maiorano | c69356e | 2023-11-23 18:04:51 +0000 | [diff] [blame] | 243 | if (CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION) |
| 244 | set (WIN10_SDK_VERSION ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}) |
| 245 | else() |
| 246 | # CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION may not be defined if, for example, |
| 247 | # the Ninja generator is used instead of Visual Studio. Attempt to retrieve the |
| 248 | # most recent SDK version from the list of paths under "${WIN10_SDK_PATH}/Include/". |
| 249 | file(GLOB sdk_dirs RELATIVE "${WIN10_SDK_PATH}/Include/" "${WIN10_SDK_PATH}/Include/10.*") |
| 250 | if (sdk_dirs) |
| 251 | list(POP_BACK sdk_dirs WIN10_SDK_VERSION) |
| 252 | endif() |
| 253 | unset(sdk_dirs) |
| 254 | endif() |
| 255 | |
| 256 | set(DXIL_DLL_PATH "${WIN10_SDK_PATH}/bin/${WIN10_SDK_VERSION}/x64/dxil.dll") |
| 257 | add_custom_target(copy_dxil_dll) |
| 258 | add_custom_command( |
| 259 | TARGET copy_dxil_dll |
| 260 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DXIL_DLL_PATH} $<TARGET_FILE_DIR:dxcompiler> |
| 261 | COMMENT "Copying ${DXIL_DLL_PATH} to $<TARGET_FILE_DIR:dxcompiler>") |
| 262 | # Make dxc target depend on copy_dxil_dll |
| 263 | add_dependencies(dxc copy_dxil_dll) |
| 264 | endif() |
| 265 | endfunction() |
| 266 | |
| 267 | if (DAWN_USE_BUILT_DXC) |
| 268 | AddSubdirectoryDXC() |
| 269 | endif() |
Ben Clayton | f9a5b71 | 2024-03-13 17:37:33 +0000 | [diff] [blame] | 270 | |
| 271 | if (TINT_BUILD_TINTD) |
| 272 | set(LANGSVR_JSON_LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/jsoncpp") |
| 273 | add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/jsoncpp" EXCLUDE_FROM_ALL) |
| 274 | add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/langsvr" EXCLUDE_FROM_ALL) |
| 275 | endif() |