简体   繁体   English

windows 上的介子找不到 llvm-lib?

[英]Meson on windows cannot find llvm-lib?

I am trying to port a Linux Library to windows, the library uses meson for compilation.我正在尝试将 Linux 库移植到 windows,该库使用介子进行编译。 I have a dummy meson.build file:我有一个虚拟的 meson.build 文件:

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

When I run meson configure I get:当我运行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

Why is meson automatically searching for these libraries when it is aware it is on windows?为什么介子知道它在 windows 上时会自动搜索这些库?

Those aren't libraries, those are static linkers (also called archivers), which are used to produce static libraries (those ending in.a or.lib, usually).这些不是库,它们是 static 链接器(也称为存档器),用于生成 static 库(通常以.a 或.lib 结尾)。 Those are pretty important to meson, and it assumes that it can find the three pieces of the toolchain (The compiler, the archiver, and the [dynamic] linker) for any given language + machine.这些对介子来说非常重要,它假设它可以找到任何给定语言 + 机器的工具链的三个部分(编译器、存档器和 [动态] 链接器)。

It is interesting to me that meson is able to pick up the cl.exe and link.exe, but not lib.exe有趣的是,介子能够获取 cl.exe 和 link.exe,但不能获取 lib.exe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM