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
[QUESTION] How to retrieve the Meson project version within the (C++) source code #4144
Comments
Pass it in your cpp_args: executable('app', sources, cpp_args : '-DVERSION=@0@'.format(meson.project_version())) Then in cpp file you can use VERSION define. |
@xclaesse Thank you, I will try this |
I find it a very poor idea to have the version controlled by the Is there any way for mason to dynamically read the version number from an external file? |
But vala doesn't support this🥲 |
Valac has a -D/—define option, you should be able to pass that to |
But Vala cannot define a value, it can only used in conditional compiling |
I can only write a |
Ah, yeah. vcs_tag() might be what you want then |
I want to get that number (the project "version" in
meson.build
) printed if I call:I failed so far to get the documentation explaining how to get that number from Meson?
The text was updated successfully, but these errors were encountered: