Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] MesonToolchain custom binaries #11961

Closed
theartful opened this issue Aug 25, 2022 · 4 comments · Fixed by #12117
Closed

[feature] MesonToolchain custom binaries #11961

theartful opened this issue Aug 25, 2022 · 4 comments · Fixed by #12117
Assignees
Milestone

Comments

@theartful
Copy link
Contributor

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.

@memsharded
Copy link
Member

memsharded commented Aug 25, 2022

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.

@theartful
Copy link
Contributor Author

theartful commented Aug 25, 2022

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()

@franramirez688
Copy link
Contributor

Hi @hesham-essam

I recently opened a PR #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.

@czoido czoido modified the milestones: 1.53, 1.54 Oct 4, 2022
@memsharded memsharded modified the milestones: 1.54, 1.55 Nov 2, 2022
@memsharded
Copy link
Member

Closed b yhttps://github.com//pull/12117, will be in Conan 1.55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants