Improve SPIRV-Headers loading behavior

This commit is contained in:
darktux 2024-04-08 00:30:51 +02:00
parent 68ced8ab4f
commit 00dd7295a3
2 changed files with 6 additions and 9 deletions

View File

@ -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)

View File

@ -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)