From 00dd7295a331167ca416805365ca70bc0fb26ab7 Mon Sep 17 00:00:00 2001 From: darktux Date: Mon, 8 Apr 2024 00:30:51 +0200 Subject: [PATCH] Improve SPIRV-Headers loading behavior --- externals/CMakeLists.txt | 6 ++++++ externals/sirit/CMakeLists.txt | 9 --------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 113634889..c8ccc1f79 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -14,6 +14,12 @@ set(BUILD_SHARED_LIBS OFF) # Skip install rules for all externals set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL ON) +# SPIRV Headers +find_package(SPIRV-Headers) +if (NOT TARGET SPIRV-Headers::SPIRV-Headers) + add_subdirectory(SPIRV-Headers) +endif() + # Xbyak (also used by Dynarmic, so needs to be added first) if ((ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) AND NOT TARGET xbyak::xbyak) add_subdirectory(xbyak) diff --git a/externals/sirit/CMakeLists.txt b/externals/sirit/CMakeLists.txt index ce887d512..0a6276db8 100644 --- a/externals/sirit/CMakeLists.txt +++ b/externals/sirit/CMakeLists.txt @@ -12,7 +12,6 @@ endif() # Sirit project options option(SIRIT_TESTS "Build tests" OFF) -option(SIRIT_USE_SYSTEM_SPIRV_HEADERS "Use system SPIR-V headers" OFF) # Default to a Release build if (NOT CMAKE_BUILD_TYPE) @@ -84,14 +83,6 @@ endif() # Enable unit-testing. enable_testing(true) -# SPIR-V headers -if (SIRIT_USE_SYSTEM_SPIRV_HEADERS) - find_package(SPIRV-Headers REQUIRED) -else() - add_subdirectory(${CMAKE_SOURCE_DIR}/externals/SPIRV-Headers externals/SPIRV-Headers EXCLUDE_FROM_ALL) - add_library(SPIRV-Headers::SPIRV-Headers ALIAS SPIRV-Headers) -endif() - # Sirit project files add_subdirectory(src) if (SIRIT_TESTS)