shaderc
shaderc copied to clipboard
`-MD` Does not escape paths with spaces
On Windows, the following invocation
glslc -MD "path\to\file with spaces.vert"
Writes to a .d
file containing the contents
file with spaces.vert.spv: path\to\file with spaces.vert
This format cannot be parsed unambiguously, because the spaces may be either a space in one filename, or a separator between different filenames. The lefthand ambiguity can be resolved by assuming there is one file before :
, but since multiple filenames can appear in the righthand expression there is no way to resolve that one.
By convention (not sure if specified anywhere), most compilers use the syntax
file\ with\ spaces.vert.spv: path\\to\\file\ with\ spaces.vert
where \
is an escape sequence for
, and \\
is an escape sequence for \
. This resolves the ambiguity.