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

Dependency for generators #4131

Closed
nacho opened this issue Sep 5, 2018 · 10 comments
Closed

Dependency for generators #4131

nacho opened this issue Sep 5, 2018 · 10 comments

Comments

@nacho
Copy link
Contributor

nacho commented Sep 5, 2018

I was having a look at the port of protobuf-c to meson and one issue they build an executable that is passed as a command line param to the generator in this format:

gen_protobuf_c = generator(protoc,
    output    : ['@BASENAME@.pb-c.c', '@BASENAME@.pb-c.h'],
    arguments : ['--proto_path=@CURRENT_SOURCE_DIR@', '--plugin=protoc-gen-c=@0@'.format(protoc_gen_c.full_path()), '--cpp_out=@BUILD_DIR@',  @INPUT@'])

When I try to use the generator it does not find the protoc_gen_c yet, I think we need a way to tell the generator that the executable has to be ready before calling it.

@ignatenkobrain
Copy link
Member

Isn't there a 'dependencies' keyword for generator?

@nacho
Copy link
Contributor Author

nacho commented Sep 5, 2018

As far as I can see there isn't: https://mesonbuild.com/Reference-manual.html#generator

@nirbheek
Copy link
Member

nirbheek commented Sep 5, 2018

The reason is that you're using .full_path(), which you're forced to because generator() only takes a single argument as the input. If you were using a custom_target() you could put that in the list of inputs (which will add a dependency on it) and then use it as @INPUT0@, etc in the arguments.

@nacho
Copy link
Contributor Author

nacho commented Sep 5, 2018

The problem I see by using custom_target is that I do not have a process method, so the inputs are basically hardcoded

@nirbheek
Copy link
Member

nirbheek commented Sep 5, 2018

We could probably add a depends kwarg (or something better-named) which you can refer to in arguments with @DEPEND@ similar to @INPUT@.

@nacho
Copy link
Contributor Author

nacho commented Sep 5, 2018

sounds good to me

@nacho
Copy link
Contributor Author

nacho commented Nov 27, 2018

@nirbheek I tried to have a look at the patch but I have not much knowledge of the internals of meson. Any chance you could make a patch for this? would be awesome to have protobuf-c with meson

@edmonds
Copy link

edmonds commented May 18, 2019

Hi, protobuf-c maintainer here. I'd still like to switch protobuf-c from autotools/cmake to meson at some point, but if I recall correctly we were stuck on this issue. Any progress?

Thanks!

@jpakkane
Copy link
Member

Can you test if #5407 fixes it for you?

@edmonds
Copy link

edmonds commented May 20, 2019

@jpakkane Just tested and that does appear to fix it. Thank you!

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

No branches or pull requests

5 participants