From 12cfd10e6a3638195b4c69c1b251327e338964cb Mon Sep 17 00:00:00 2001 From: Samuel Longchamps Date: Fri, 25 Dec 2020 13:34:49 -0800 Subject: [PATCH] Fix network path output in ninja backend on Windows --- mesonbuild/backend/ninjabackend.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 40d4ae3e5..b9be80ff4 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: