google / google/shaderc

`-MD` Does not escape paths with spaces

Open
#1,220 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.2k
Forks
445
Avg merge
11h 6m
Merged PRs (30d)
6

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.