Fix GLSLANG_ENABLE_INSTALL when SHADERC_SKIP_INSTALL is ON - #1592
Open
rootkiller6788 wants to merge 1 commit into
Open
rootkiller6788 wants to merge 1 commit into
rootkiller6788 wants to merge 1 commit into
Conversation
The generator expression set(GLSLANG_ENABLE_INSTALL $<NOT:${SKIP_GLSLANG_INSTALL}>)
is not evaluated at configure time. When SHADERC_SKIP_INSTALL is ON the
variable holds the literal string "$<NOT:ON>", which is truthy, so glslang
still installs its targets. Since SPIRV-Tools' install is skipped in that
case, glslang's install(EXPORT) fails to generate with:
install(EXPORT "glslang-targets" ...) includes target "SPIRV" which
requires target "SPIRV-Tools-opt" that is not in any export set.
Compute the boolean directly from SKIP_GLSLANG_INSTALL instead.
Fixes google#1435
rootkiller6788
marked this pull request as ready for review
August 29, 2026 13:24
|
I encountered the same problem. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running
cmakewithSHADERC_SKIP_INSTALL=ONfails during generation:Root cause
third_party/CMakeLists.txtsetsGenerator expressions are not evaluated at configure time. When
SHADERC_SKIP_INSTALLisON, the variable holds the literal string$<NOT:ON>, which CMake'sif()treats as truthy, so glslang still enables its install rules. Since SPIRV-Tools' install is skipped in that configuration, glslang'sinstall(EXPORT glslang-targets)references targets (SPIRV,glslang) whose dependencySPIRV-Tools-optis not in any export set, and generation fails.Fix
Compute the boolean directly instead of relying on a generator expression:
Verification
cmake -DSHADERC_SKIP_INSTALL=ON ...previously failed with the error above; with the fix it configures successfully and glslang'scmake_install.cmakecontains no install rules.SHADERC_SKIP_INSTALL) still configures successfully and glslang's install rules are unchanged.Fixes #1435