mesonbuild/meson

Inconsistency between library suffix generated on windows and link name created when using dependency()

Open

#1.907 geöffnet am 6. Juni 2017

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (1.465 Forks)batch import
OS:windowsbugdependencieshelp wanted

Repository-Metriken

Stars
 (4.978 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 139T 13h) (51 gemergte PRs in 30 T)

Beschreibung

Meson wants to create libraries with the style liblibname.a even on Windows. I can deal with that.

Note the following in the meson build.py source:

    # By default a static library is named libfoo.a even on Windows because
    # MSVC does not have a consistent convention for what static libraries
    # are called. The MSVC CRT uses libfoo.lib syntax but nothing else uses
    # it and GCC only looks for static libraries called foo.lib and
    # libfoo.a. However, we cannot use foo.lib because that's the same as
    # the import library. Using libfoo.a is ok because people using MSVC
    # always pass the library filename while linking anyway.

However, when using a pkg-config dependency setup for the library, meson will try to link with libname.lib, not the liblibname.a that was created.

Summary: In project A: meson creates libs with liblibname.a format in C:/lib/ folder (when installed) a .pc file is created using the pkg.generate() command (although I have to manually change \ to /)

in Project B: I want to link with the library from project A. meson finds the .pc file ok however, generates link command -llibname.lib

These behaviours are inconsistent

Contributor Guide