summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorjarcherNV <jarcher@nvidia.com>2025-03-06 19:16:27 -0800
committerGitHub <noreply@github.com>2025-03-07 03:16:27 +0000
commit9d7d943db47dd7805a710431cf7eedc0bec8ecc7 (patch)
tree851f51e2087f76b39ea19a8ca4ec8cf4555a4bb2 /CMakeLists.txt
parent2aaa91007a9f91674033dcb9d88eb9ad7bacae96 (diff)
Update build to allow setting external paths (#6528)
* Update build to allow setting external paths Update the build to allow setting user-specific paths for the external modules. This allows building Slang without also fetching the external modules, assuming they are already present elsewhere locally.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt41
1 files changed, 41 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 48d263d14..a74047e0f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -166,6 +166,43 @@ option(
)
mark_as_advanced(SLANG_SPIRV_HEADERS_INCLUDE_DIR)
+# Options for user defined paths for external modules.
+advanced_option(
+ SLANG_OVERRIDE_LZ4_PATH
+ "Build using user defined path for LZ4"
+ OFF
+)
+advanced_option(
+ SLANG_OVERRIDE_MINIZ_PATH
+ "Build using user defined path for Miniz"
+ OFF
+)
+advanced_option(
+ SLANG_OVERRIDE_UNORDERED_DENSE_PATH
+ "Build using user defined path for unordered_dense"
+ OFF
+)
+advanced_option(
+ SLANG_OVERRIDE_VULKAN_HEADERS_PATH
+ "Build using user defined path for Vulkan headers"
+ OFF
+)
+advanced_option(
+ SLANG_OVERRIDE_SPIRV_HEADERS_PATH
+ "Build using user defined path for SPIR-V headers"
+ OFF
+)
+advanced_option(
+ SLANG_OVERRIDE_SPIRV_TOOLS_PATH
+ "Build using user defined path for SPIR-V tools"
+ OFF
+)
+advanced_option(
+ SLANG_OVERRIDE_GLSLANG_PATH
+ "Build using user defined path for glslang, this also requires "
+ OFF
+)
+
if(${SLANG_USE_SYSTEM_LZ4})
add_compile_definitions(SLANG_USE_SYSTEM_LZ4_HEADER)
endif()
@@ -178,6 +215,10 @@ if(${SLANG_USE_SYSTEM_UNORDERED_DENSE})
add_compile_definitions(SLANG_USE_SYSTEM_UNORDERED_DENSE_HEADER)
endif()
+if(SLANG_OVERRIDE_SPIRV_HEADERS_PATH)
+ add_compile_definitions(SLANG_USE_SYSTEM_SPIRV_HEADER)
+endif()
+
enum_option(
SLANG_LIB_TYPE
# Default