summaryrefslogtreecommitdiffstats
path: root/source/slang-glsl-module
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2025-02-12 13:53:15 +0800
committerGitHub <noreply@github.com>2025-02-11 21:53:15 -0800
commit0fee8c16e25521d13b50427ac6bf87d7f3419b9c (patch)
tree05f8804ddd2dfc47469f41288f95ec50fca9416a /source/slang-glsl-module
parentee99becbf02b91635338203e44b79c3814bddc2c (diff)
build core and glsl modules in the same slang-bootstrap invocation (#6341)
Closes https://github.com/shader-slang/slang/issues/6339
Diffstat (limited to 'source/slang-glsl-module')
-rw-r--r--source/slang-glsl-module/CMakeLists.txt21
1 files changed, 9 insertions, 12 deletions
diff --git a/source/slang-glsl-module/CMakeLists.txt b/source/slang-glsl-module/CMakeLists.txt
index 95787f01d..21e7e0683 100644
--- a/source/slang-glsl-module/CMakeLists.txt
+++ b/source/slang-glsl-module/CMakeLists.txt
@@ -1,19 +1,15 @@
#
# Generate an embeddable glsl module
#
-set(glsl_module_generated_header_dir ${CMAKE_CURRENT_BINARY_DIR})
-set(glsl_module_generated_header
- ${glsl_module_generated_header_dir}/slang-glsl-module-generated.h
-)
-add_custom_command(
- OUTPUT ${glsl_module_generated_header}
- COMMAND
- slang-bootstrap -archive-type riff-lz4 -save-glsl-module-bin-source
- ${glsl_module_generated_header}
- DEPENDS slang-bootstrap
- VERBATIM
-)
+# This header is generated in the same call to slang-bootstrap that generates
+# the core module embed, which can be found in
+# ../slang-core-module/CMakeLists.txt
+# The target to look for is generate_core_module_headers
+
+# CMake doesn't allow creating an implicit dependency across directory scopes,
+# see https://cmake.org/cmake/help/v3.31/prop_sf/GENERATED.html. Because of
+# this we add the explicit REQUIRES
slang_add_target(
.
MODULE
@@ -23,6 +19,7 @@ slang_add_target(
EXPLICIT_SOURCE
./slang-embedded-glsl-module.cpp
${glsl_module_generated_header}
+ REQUIRES generate_core_module_headers
EXCLUDE_FROM_ALL
EXTRA_COMPILE_DEFINITIONS_PRIVATE SLANG_SHARED_LIBRARY_TOOL
EXPORT_SET_NAME SlangTargets