aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2020-02-28 23:56:55 +0200
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2020-09-18 05:30:49 +0000
commit9d8906363ecd682b4b03064a862fd17069a70df4 (patch)
tree2084edbcbdf91ed59bb89770c362aaea28d8abc1
parent17f07a53d09e9418cf73958905f724c8f31b5f8c (diff)
downloadmeson-9d8906363ecd682b4b03064a862fd17069a70df4.zip
meson-9d8906363ecd682b4b03064a862fd17069a70df4.tar.gz
meson-9d8906363ecd682b4b03064a862fd17069a70df4.tar.bz2
Support identifying msvc dependency prefix with a path starting with a backslash
-rw-r--r--mesonbuild/backend/ninjabackend.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index f95c29b..e21da29 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -464,8 +464,13 @@ int dummy;
# different locales have different messages with a different
# number of colons. Match up to the the drive name 'd:\'.
# When used in cross compilation, the path separator is a
- # forward slash rather than a backslash so handle both.
- matchre = re.compile(rb"^(.*\s)([a-zA-Z]:\\|\/).*stdio.h$")
+ # forward slash rather than a backslash so handle both; i.e.
+ # the path is /MyDir/include/stdio.h.
+ # With certain cross compilation wrappings of MSVC, the paths
+ # use backslashes, but without the leading drive name, so
+ # allow the path to start with any path separator, i.e.
+ # \MyDir\include\stdio.h.
+ matchre = re.compile(rb"^(.*\s)([a-zA-Z]:\\|[\\\/]).*stdio.h$")
def detect_prefix(out):
for line in re.split(rb'\r?\n', out):