1

I am trying to build on windows using meson and conan.

I installed packages for VS 2017 using conan and generated the PC files in the build directory.

Inside my conan.py I have the snippet:

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.

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>.

I am confused.

Makogan
  • 8,208
  • 7
  • 44
  • 112

1 Answers1

1

Try specify instead -Dbuild.pkg_config_path=... from 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, the version of meson and that you have native build I deduced from your previous question ;)

pmod
  • 10,450
  • 1
  • 37
  • 50