mesonbuild/meson

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

Open

#1 907 ouverte le 6 juin 2017

Voir sur GitHub
 (3 commentaires) (0 réactions) (0 assignés)Python (1 465 forks)batch import
OS:windowsbugdependencieshelp wanted

Métriques du dépôt

Stars
 (4 978 stars)
Métriques de merge PR
 (Merge moyen 139j 13h) (51 PRs mergées en 30 j)

Description

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

Guide contributeur