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 # Skip install rules for all externals
set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL ON) 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) # Xbyak (also used by Dynarmic, so needs to be added first)
if ((ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) AND NOT TARGET xbyak::xbyak) if ((ARCHITECTURE_x86 OR ARCHITECTURE_x86_64) AND NOT TARGET xbyak::xbyak)
add_subdirectory(xbyak) add_subdirectory(xbyak)

View file

@ -12,7 +12,6 @@ endif()
# Sirit project options # Sirit project options
option(SIRIT_TESTS "Build tests" OFF) option(SIRIT_TESTS "Build tests" OFF)
option(SIRIT_USE_SYSTEM_SPIRV_HEADERS "Use system SPIR-V headers" OFF)
# Default to a Release build # Default to a Release build
if (NOT CMAKE_BUILD_TYPE) if (NOT CMAKE_BUILD_TYPE)
@ -84,14 +83,6 @@ endif()
# Enable unit-testing. # Enable unit-testing.
enable_testing(true) 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 # Sirit project files
add_subdirectory(src) add_subdirectory(src)
if (SIRIT_TESTS) if (SIRIT_TESTS)