diff options
| author | Niklas Korz <niklas@niklaskorz.de> | 2025-08-20 21:52:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-20 19:52:42 +0000 |
| commit | 619de903b70e08a7ca8471419e8eb7e4dd43ca9d (patch) | |
| tree | a0d4ca8095bc7c876af7c7896334bb6f10b598be /external | |
| parent | 82e3fc9c1064f06780f6449154c7cf8f663fceac (diff) | |
Add more system dependency options to CMake (#7987)
Allows opt-in for sourcing the following dependencies from the system,
instead of using the vendored ones:
- miniz
- lz4
- vulkan-headers
- spirv-tools
- glslang
(some of these already had options that weren't working, as either it
expected them to be static libraries or it was expecting to be embedded
in another CMakeList that should provide the package, instead of finding
the package itself)
This is based on a patch we currently maintain inside nixpkgs, but as it
frequently conflicts with new slang releases, it would be nice to see
get
this upstream.
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Sam Estep <sam@samestep.com>
Diffstat (limited to 'external')
| -rw-r--r-- | external/CMakeLists.txt | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index d8b4c2bca..faa8a5730 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -142,35 +142,40 @@ if(SLANG_ENABLE_SLANG_GLSLANG) ) endif() - # SPIRV-Tools - set(SPIRV_TOOLS_BUILD_STATIC ON) - set(SPIRV_WERROR OFF) - set(SPIRV_SKIP_TESTS ON) - # Tools - if(NOT SLANG_OVERRIDE_SPIRV_TOOLS_PATH) - add_subdirectory(spirv-tools EXCLUDE_FROM_ALL ${system}) - else() - add_subdirectory( - ${SLANG_OVERRIDE_SPIRV_TOOLS_PATH}/spirv-tools - spirv-tools - EXCLUDE_FROM_ALL - ${system} - ) + if(NOT ${SLANG_USE_SYSTEM_SPIRV_TOOLS}) + # SPIRV-Tools + set(SPIRV_TOOLS_BUILD_STATIC ON) + set(SPIRV_WERROR OFF) + set(SPIRV_SKIP_TESTS ON) + # Tools + if(NOT SLANG_OVERRIDE_SPIRV_TOOLS_PATH) + add_subdirectory(spirv-tools EXCLUDE_FROM_ALL ${system}) + else() + add_subdirectory( + ${SLANG_OVERRIDE_SPIRV_TOOLS_PATH}/spirv-tools + spirv-tools + EXCLUDE_FROM_ALL + ${system} + ) + endif() endif() - # glslang - set(SKIP_GLSLANG_INSTALL ON) - set(ENABLE_OPT ON) - set(ENABLE_PCH OFF) - if(NOT SLANG_OVERRIDE_GLSLANG_PATH) - add_subdirectory(glslang EXCLUDE_FROM_ALL ${system}) - else() - add_subdirectory( - ${SLANG_OVERRIDE_GLSLANG_PATH}/glslang - glslang - EXCLUDE_FROM_ALL - ${system} - ) + if(NOT ${SLANG_USE_SYSTEM_GLSLANG}) + # glslang + set(SKIP_GLSLANG_INSTALL ON) + set(ENABLE_OPT ON) + set(ENABLE_PCH OFF) + set(ALLOW_EXTERNAL_SPIRV_TOOLS ${SLANG_USE_SYSTEM_SPIRV_TOOLS}) + if(NOT SLANG_OVERRIDE_GLSLANG_PATH) + add_subdirectory(glslang EXCLUDE_FROM_ALL ${system}) + else() + add_subdirectory( + ${SLANG_OVERRIDE_GLSLANG_PATH}/glslang + glslang + EXCLUDE_FROM_ALL + ${system} + ) + endif() endif() endif() |
