windows 上的 Meson 找不到 llvm-lib?

Meson on windows cannot find llvm-lib?

我正在尝试将 Linux 库移植到 windows,该库使用介子进行编译。我有一个虚拟 meson.build 文件:

project(
    'Dummy',
    'cpp',
    version: '0.0.1',
    license: 'GPL',
    default_options : [
        'cpp_std=c++latest',
        'default_library=static',
        'optimization=3',
        'buildtype=debugoptimized'])

当我 运行 meson configure 我得到:

PS C:\Users\Makogan\Documents\neverengine\build> meson compile
[0/1] Regenerating build files.
The Meson build system
Version: 0.60.3
Source dir: C:\Users\Makogan\Documents\neverengine
Build dir: C:\Users\Makogan\Documents\neverengine\build
Build type: native build
Project name: NeverEngine
Project version: 0.0.1
C++ compiler for the host machine: cl (msvc 19.13.26131.1 "Microsoft (R) C/C++ Optimizing Compiler Version 19.13.26131.1 for x64")
C++ linker for the host machine: link link 14.13.26131.1

..\meson.build:1:0: ERROR: Unknown linker(s): [['lib'], ['llvm-lib']]
The following exception(s) were encountered:
Running "lib /?" gave "[WinError 2] The system cannot find the file specified"
Running "llvm-lib /?" gave "[WinError 2] The system cannot find the file specified"

A full log can be found at C:\Users\Makogan\Documents\neverengine\build\meson-logs\meson-log.txt
FAILED: build.ninja 
"C:\Python311\Scripts\meson" "--internal" "regenerate" "C:\Users\Makogan\Documents\neverengine" "C:\Users\Makogan\Documents\neverengine\build" "--backend" "ninja"
ninja: error: rebuilding 'build.ninja': subcommand failed

为什么 meson 知道它在 windows 上时会自动搜索这些库?

那些不是库,它们是静态链接器(也称为归档器),用于生成静态库(通常以 .a 或 .lib 结尾)。这些对介子来说非常重要,它假设它可以为任何给定的语言+机器找到工具链的三个部分(编译器、归档器和[动态]链接器)。

有趣的是,介子能够拾取 cl.exe 和 link.exe,但不能拾取 lib.exe