diff options
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 40d4ae3..b9be80f 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -374,6 +374,13 @@ class NinjaBuildElement: # do not require quoting, unless explicitly specified, which is necessary for # the csc compiler. line = line.replace('\\', '/') + if mesonlib.is_windows(): + # Support network paths as backslash, otherwise they are interpreted as + # arguments for compile/link commands when using MSVC + line = ' '.join( + (l.replace('//', '\\\\', 1) if l.startswith('//') else l) + for l in line.split(' ') + ) outfile.write(line) if use_rspfile: |