diff options
author | Alexandre Bouvier <[email protected]> | 2021-08-09 23:26:14 +0200 |
---|---|---|
committer | Rodrigo Locatti <[email protected]> | 2022-05-14 15:59:52 -0300 |
commit | aa292d56650bc28f2b2d75973fab2e61d0136f9c (patch) | |
tree | 933a27647277f477da23da3265d46b25beb5e322 /CMakeLists.txt | |
parent | b8f133bf631ace5a613bbd7e8329300358cacbd2 (diff) | |
download | sirit-aa292d56650bc28f2b2d75973fab2e61d0136f9c.tar.gz sirit-aa292d56650bc28f2b2d75973fab2e61d0136f9c.zip |
cmake: Support using system SPIRV-Headers
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b0574f..ca7e3b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,10 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) set(MASTER_PROJECT ON) 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) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) @@ -81,7 +85,12 @@ endif() enable_testing(true) # SPIR-V headers -add_subdirectory(externals/SPIRV-Headers EXCLUDE_FROM_ALL) +if (SIRIT_USE_SYSTEM_SPIRV_HEADERS) + find_package(SPIRV-Headers REQUIRED) +else() + add_subdirectory(externals/SPIRV-Headers EXCLUDE_FROM_ALL) + add_library(SPIRV-Headers::SPIRV-Headers ALIAS SPIRV-Headers) +endif() # Sirit project files add_subdirectory(src) |