diff --git a/src/dawn_native/CMakeLists.txt b/src/dawn_native/CMakeLists.txt index 1b3440213d..b7db56139e 100644 --- a/src/dawn_native/CMakeLists.txt +++ b/src/dawn_native/CMakeLists.txt @@ -150,6 +150,9 @@ target_link_libraries(dawn_native dawn_platform dawn_internal_config spirv-cross-core + spirv-cross-glsl + spirv-cross-hlsl + SPIRV-Tools ) if (DAWN_USE_X11) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index b228539de9..868a1f6b6e 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -12,6 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +if (NOT TARGET spirv-cross) + set(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS ON CACHE BOOL "" FORCE) + set(SPIRV_CROSS_ENABLE_TESTS OFF CACHE BOOL "" FORCE) + set(SPIRV_CROSS_SKIP_INSTALL ON CACHE BOOL "" FORCE) + + message(STATUS "Dawn: using spirv-cross at ${DAWN_SPIRV_CROSS_DIR}") + add_subdirectory(${DAWN_SPIRV_CROSS_DIR}) +endif() + if (NOT TARGET SPIRV-Headers) set(SPIRV_HEADERS_SKIP_EXAMPLES ON CACHE BOOL "" FORCE) set(SPIRV_HEADERS_SKIP_INSTALL ON CACHE BOOL "" FORCE)