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.
pull/6228/head
Michael Hirsch, Ph.D 5 years ago
parent da9f56afde
commit 818c92003c
No known key found for this signature in database
GPG Key ID: 6D23CDADAB0294F9
  1. 5
      mesonbuild/dependencies/base.py

@ -152,7 +152,7 @@ class Dependency:
return converted return converted
return self.compile_args 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: if raw and self.raw_link_args is not None:
return self.raw_link_args return self.raw_link_args
return self.link_args return self.link_args
@ -724,6 +724,9 @@ class PkgConfigDependency(ExternalDependency):
elif arg.startswith('/'): elif arg.startswith('/'):
pargs = PurePath(arg).parts pargs = PurePath(arg).parts
tmpl = '{}:/{}' 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: if len(pargs) > 1 and len(pargs[1]) == 1:
arg = tmpl.format(pargs[1], '/'.join(pargs[2:])) arg = tmpl.format(pargs[1], '/'.join(pargs[2:]))
converted.append(arg) converted.append(arg)

Loading…
Cancel
Save