[tint][cmake] Default enable HLSL for D3D11 The HLSL writer should be default enabled for both D3D12 and D3D11. This is an upstreaming of the patch in vcpkg's port of Dawn that has some fixes to the CMake build for Windows. Bug: 522791659 Change-Id: Id8e533e03e1bf7b985926be539a76c4581a359e3 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/316916 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Natalie Chouinard <chouinard@google.com> Reviewed-by: James Price <jrprice@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt index 015f968..9a90f5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -223,6 +223,12 @@ set(TINT_DEFAULT_GLSL OFF) endif() +if (DAWN_ENABLE_D3D11 OR DAWN_ENABLE_D3D12) + set(TINT_DEFAULT_HLSL ON) +else() + set(TINT_DEFAULT_HLSL OFF) +endif() + option(TINT_ENABLE_INSTALL "Enable install step for Tint libraries" OFF) option(TINT_BUILD_CMD_TOOLS "Build the Tint command line tools" ON) @@ -236,7 +242,7 @@ option(TINT_BUILD_WGSL_READER "Build the WGSL input reader" ON) option(TINT_BUILD_GLSL_WRITER "Build the GLSL output writer" ${TINT_DEFAULT_GLSL}) option(TINT_BUILD_GLSL_VALIDATOR "Build the GLSL output validator" ON) -option(TINT_BUILD_HLSL_WRITER "Build the HLSL output writer" ${DAWN_ENABLE_D3D12}) +option(TINT_BUILD_HLSL_WRITER "Build the HLSL output writer" ${TINT_DEFAULT_HLSL}) option(TINT_BUILD_MSL_WRITER "Build the MSL output writer" ${DAWN_ENABLE_METAL}) option(TINT_BUILD_SPV_WRITER "Build the SPIR-V output writer" ${DAWN_ENABLE_VULKAN}) option(TINT_BUILD_WGSL_WRITER "Build the WGSL output writer" ON)