[cmake] Only require DXC for fuzzers if being explicitly built
Matches GN behaviour,
https://dawn-review.googlesource.com/c/dawn/+/239254, and prevents
unexpected linking issues when building HLSL writer.
Fixes: 455606190
Change-Id: Iea616167c9f75a983998afe79a6da07865ef7bf6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/269634
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/src/tint/CMakeLists.txt b/src/tint/CMakeLists.txt
index bff88dc..13ab189 100644
--- a/src/tint/CMakeLists.txt
+++ b/src/tint/CMakeLists.txt
@@ -524,7 +524,7 @@
elseif(${DEPENDENCY} STREQUAL "dxc-include")
target_include_directories(${TARGET} PRIVATE "${DAWN_THIRD_PARTY_DIR}/dxc/include")
elseif(${DEPENDENCY} STREQUAL "dxcompiler-for-fuzzer")
- if(TINT_BUILD_FUZZERS) # TODO: and target arch is not x86
+ if(TINT_BUILD_FUZZERS AND DAWN_USE_BUILT_DXC) # TODO: and target arch is not x86
target_link_libraries(${TARGET} PRIVATE dxcompiler)
endif()
elseif(${DEPENDENCY} STREQUAL "jsoncpp")