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

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

我正在尝试使用介子和柯南在 windows 的基础上进行构建。

我使用 conan 安装了 VS 2017 的包,并在构建目录中生成了 PC 文件。

在我的 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'])

我已经检查并确认这个有效并且目录是正确的。

我也尝试过使用绝对路径:

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

但是meson不知为何还是找不到包裹

确切的错误是:

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

如果我这样做确实有效 meson --reconfigure -Dpkg_config=<path>

我很困惑。

尝试指定 -Dbuild.pkg_config_path=... 来自 this

Since 0.51.0, some options are specified per machine rather than globally for all machine configurations. Prefixing the option with 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).

PS,介子的版本以及我从您之前的问题中推断出的本地版本 ;)