mesonbuild/meson

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

Open

#1,907 opened on 2017年6月6日

GitHub で見る
 (3 comments) (0 reactions) (0 assignees)Python (4,978 stars) (1,465 forks)batch import
OS:windowsbugdependencieshelp wanted

説明

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

コントリビューターガイド