CMake: Guard inclusion of VULKAN_HEADERS and SPIRV-Headers#8124
Conversation
… already included.
17d4372 to
cfd2dfe
Compare
jkwak-work
left a comment
There was a problem hiding this comment.
@expipiplus1 and @jarcherNV for second opinion.
| if(SLANG_USE_SYSTEM_SPIRV_HEADERS) | ||
| if(SLANG_OVERRIDE_SPIRV_HEADERS_PATH) | ||
| message( | ||
| WARNING | ||
| "SLANG_OVERRIDE_SPIRV_HEADERS_PATH does nothing when SLANG_USE_SPIRV_HEADERS is set" | ||
| ) |
There was a problem hiding this comment.
I think this should be an error so that the user can fix it right away.
And from the naming perspective, "override" sounds like it could/should override SLANG_USE_SYSTEM_SPIRV_HEADERS; not the other way around.
But it wouldn't matter if it is an error and the build stops here.
|
Looking at the original issue, are you sure this change is needed? If I understand correctly, the problem you are having is that Slang is attempting to use its own spirv and vulkan headers from the external submodules rather than yours? It is posible to override this behavior though, eg: -DSLANG_OVERRIDE_VULKAN_HEADERS_PATH=/path/to/vulkan/headers Does this not work for your project? |
I think the intention is to use ones installed on the system. So I guess there are three ways to use SPIRV-HEADER/TOOLS now.
|
|
Ok that makes sense. If that third option is currently broken and this fixes it then that sounds reasonable to me. |
This does not work in my project because it has its own Vulkan and SPIR-V header libraries, which are included first. However, with the above command, Slang also tries to include them, resulting in the following error:
No, I don't use the third option. As I mentioned, my project uses its own instances of SPIR-V and Vulkan headers, which are not the system ones (i.e., they are not added via |
…or due to variable caching.
|
/format |
|
🌈 Formatted, please merge the changes from this PR |
Head branch was pushed to by a user without write access
|
It requires workflow approval. @expipiplus1, @jarcherNV, @jkwak-work, could someone approve it and tick auto-mere if all looks good? |
Don't include the VULKAN_HEADERS and SPIRV-Headers submodule if they are already included.
Fix for the #7898.