简体   繁体   English

介子找不到柯南 package,尽管设置了 pkg_config 路径?

[英]meson cannot find a conan package, despite setting pkg_config path?

I am trying to build on windows using meson and conan.我正在尝试使用介子和柯南在 windows 上进行构建。

I installed packages for VS 2017 using conan and generated the PC files in the build directory.我使用柯南为 VS 2017 安装了软件包,并在构建目录中生成了 PC 文件。

Inside my conan.py I have the snippet:在我的 conan.py 中,我有以下代码段:

meson = Meson(self)
        self.output.warn(self.folders.generators)
        meson.configure(build_folder="build", args=[
            f"-Dpkg_config_path={self.folders.generators}",
            f"-Db_sanitize=undefined"
        ])
        meson.build(args=['-j2'])

I have checked and confirmed this works and that the directory is correct.我已经检查并确认这有效并且目录是正确的。

I also tried using absolute paths by doing:我还尝试通过执行以下操作使用绝对路径:

os.path.abspath(self.folders.generators)

But meson still cannot find the package for some reason.但是介子由于某种原因仍然找不到 package。

The exact error is:确切的错误是:

Found pkg-config: C:\msys64\mingw64\bin\pkg-config.EXE (1.8.0)
Found CMake: C:\Program Files\CMake\bin\cmake.EXE (3.22.1)
Run-time dependency vulkan-memory-allocator found: NO (tried pkgconfig and cmake)

..\meson.build:97:0: ERROR: Dependency "vulkan-memory-allocator" not found, tried pkgconfig and cmake

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
ERROR: conanfile.py: Error in build() method, line 108
        meson.build(args=['-j2'])
        ConanException: Error 1 while executing ninja -C "C:\Users\Makogan\Documents\neverengine\build" -j2

It does work if I do meson --reconfigure -Dpkg_config=<path> .如果我做meson --reconfigure -Dpkg_config=<path> ,它确实有效。

I am confused.我很困惑。

Try specify instead -Dbuild.pkg_config_path=... from this尝试从这里指定 -Dbuild.pkg_config_path=...

Since 0.51.0, some options are specified per machine rather than globally for all machine configurations.从 0.51.0 开始,某些选项是为每台机器指定的,而不是为所有机器配置全局指定的。 Prefixing the option with build.使用 build 为选项添加前缀。 just affects the build machine configuration...只会影响构建机器配置...

build.pkg_config_path controls the paths pkg-config will search for just native: true dependencies (build machine). build.pkg_config_path 控制 pkg-config 将仅搜索 native: true 依赖项(构建机器)的路径。

PS, the version of meson and that you have native build I deduced from your previous question;) PS,介子的版本以及我从您之前的问题中推断出的本地构建;)

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

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