mesonbuild/meson

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

Open

#1,907 创建于 2017年6月6日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)Python (4,978 star) (1,465 fork)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

贡献者指南

Inconsistency between library suffix generated on windows and link name created when using dependency() · mesonbuild/meson#1907 | Good First Issue