Open dankegel opened 5 years ago
Patching PkgConfigDependency._search_libs like this:
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -739,7 +739,7 @@ class PkgConfigDependency(ExternalDependency):
# We also store this raw_link_args on the object later
raw_link_args = self._convert_mingw_paths(shlex.split(out_raw))
for arg in raw_link_args:
- if arg.startswith('-L') and not arg.startswith(('-L-l', '-L-L')):
+ if arg.startswith('-L') and not arg.startswith(('-L-l', '-L-L')) and not arg.startswith(('-LIBPATH:')):
path = arg[2:]
if not os.path.isabs(path):
# Resolve the path as a compiler in the build directory would
causes the -LIBPATH: option to be dropped rather than mangled, so that's a bit of a clue.
https://github.com/mesonbuild/meson/pull/5812 adds real test cases and a quick-and-dirty workaround.
This is similar to #5727
I just ran into this with meson 0.51.1.
I have a .pc file that contains -libpath. Standalone pkgconfig outputs:
but ninja mangles this to "ibpath:C://opt/oblong/deps-64-13/lib.lib":
Looks like master knows a little about /libpath:
On a hunch, I changed all my pc files to use /libpath rather than -libpath, and it worked around the problem.
I can't remember exactly why I settled on -libpath: rather than /libpath. I think I had to do that to squeak by some other problem. Indeed, using /libpath: in the .pc files causes my cmake build to fail with
And I don't think I'm the only one using -libpath: rather than /libpath:, so perhaps Meson should accept the alternate form.