aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-11-24 00:11:11 -0500
committerMichael Hirsch, Ph.D <scivision@users.noreply.github.com>2019-11-30 21:27:40 -0500
commit818c92003c41b72194cdc668a3346a4b7247bd23 (patch)
treeaf844f8c97a8e0f8e50078fd62b3dada4fe81337
parentda9f56afdeb67202e11441b46694e5186aeec2d0 (diff)
downloadmeson-818c92003c41b72194cdc668a3346a4b7247bd23.zip
meson-818c92003c41b72194cdc668a3346a4b7247bd23.tar.gz
meson-818c92003c41b72194cdc668a3346a4b7247bd23.tar.bz2
fix extraneous '\\ ' in some windows pkg-config files
This fixes general issues with pkg-config on Windows, including specifically with Intel MKL that has "wrongly" escaped spaces on Windows.
-rw-r--r--mesonbuild/dependencies/base.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 06ea1c3..13f2470 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -152,7 +152,7 @@ class Dependency:
return converted
return self.compile_args
- def get_link_args(self, raw=False):
+ def get_link_args(self, raw: bool = False) -> typing.List[str]:
if raw and self.raw_link_args is not None:
return self.raw_link_args
return self.link_args
@@ -724,6 +724,9 @@ class PkgConfigDependency(ExternalDependency):
elif arg.startswith('/'):
pargs = PurePath(arg).parts
tmpl = '{}:/{}'
+ elif arg.startswith(('-L', '-I')) or arg[1] == ':':
+ # clean out improper '\\ ' as comes from some Windows pkg-config files
+ arg = arg.replace('\\ ', ' ')
if len(pargs) > 1 and len(pargs[1]) == 1:
arg = tmpl.format(pargs[1], '/'.join(pargs[2:]))
converted.append(arg)