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

Meson-generated config.h file don't allow C++ style comments (//) #14260

Open
brunvonlope opened this issue Feb 16, 2025 · 2 comments
Open

Meson-generated config.h file don't allow C++ style comments (//) #14260

brunvonlope opened this issue Feb 16, 2025 · 2 comments

Comments

@brunvonlope
Copy link
Contributor

Describe the bug
If you use something like conf.configuration_data() and conf.set('var_name', var_value), the produced config.h file will have a C-style header:

/*
 * Autogenerated by the Meson build system.
 * Do not edit, your changes will be lost.
 */

Inno Setup scripts are not compatible with that, they need a C++ style comment comment and I see no option in https://mesonbuild.com/Configuration.html to change that.

Creating a custom config.h file from config.h.in with configure_file isn't doable because GIMP defines more than 80 variables.

To Reproduce
Create a meson.build file with:

conf.configuration_data()
conf.set('var_name', var_value)

Run meson setup

Expected behavior
config.h file have C++ style comment, which is more universal(?), or option to choose it if it isn't the default

system parameters

  • Native build
  • Windows 11
  • Python 3.12.9 (MSYS2)
  • Meson 1.7.0 (MSYS2)
@eli-schwartz
Copy link
Member

config.h file have C++ style comment, which is more universal(?),

Technically no, single-line comments // were added later on in c99 and the original comment style was multi-line block comments /*

@bruchar1
Copy link
Member

I guess we could add a c++ output format.

gnomesysadmins pushed a commit to GNOME/gimp that referenced this issue Feb 23, 2025
Now, we don't need to set a lot of params when calling 'issc' anymore.
The version vars will be taken from Meson, being more future-proof.

This is not 100% future-proof, however, because we unfortunately can not
take 'config.h' vars directly due to Meson limitations:
mesonbuild/meson#14260
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

3 participants