[feature] MesonToolchain custom binaries
Meson can use the binaries section in the meson ini file for finding programs. See https://mesonbuild.com/Machine-files.html#binaries
Currently only a specific list of binaries are added c, cpp, objc, objcpp, c_ld, cpp_ld, ar, strip, as, windres, pkgconfig. It would be great if these were dictionary that allows any binary.
Hi @hesham-essam
Sorry, but I don't know what you mean, and how it is related to Conan. Can you please put a full example of what you are suggesting? Starting with the conan hello/0.1 --template=meson_lib can be a good start for this.
MesonToolchain generates conan_meson_native.ini. This file consists of a number of sections. One of these sections is [binaries], which specifies a number of programs for internal use of meson and for finding programs.
I would like not to edit the PATH environment variable for meson to find a specific executable, and instead provide it in the binaries section.
For example, if I have a meson file that contains
glib_compile_resources = find_program('glib-compile-resources')
I would like to be able to do
def generate(self):
tc = MesonToolchain(self)
tc.binaries["glib_compile_resources"] = "path/to/glib-compile-resources"
tc.generate()
Hi @hesham-essam
I recently opened a PR https://github.com/conan-io/conan/pull/12117 to let users define their own Meson files to be appended after the Conan ones. Those user files will override/complement the Conan ones. This feature is based on https://mesonbuild.com/Machine-files.html. I think it's better than adding another dictionary to avoid having many attributes inside the MesonToolchain.
Closed b yhttps://github.com/conan-io/conan/pull/12117, will be in Conan 1.55