mesonbuild/meson

Add a mechanism to add prefix/suffixes to configuration files

Open

#1.492 geöffnet am 22. März 2017

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (1.465 Forks)batch import
enhancementhelp wanted

Repository-Metriken

Stars
 (4.978 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 139T 13h) (51 gemergte PRs in 30 T)

Beschreibung

Right now, with configure_file() if the input: kwarg is not set, we just dump the entire configuration. This has the advantage of not having to maintain a duplicate list of defines (one in meson.build, another in config.h.in) and is less error-prone.

However, this leaves a gap: sometimes the config.h is mostly generated, but has a few static defines in it. We should implement a way to also add these to the generated config.h. There are two ways to implement this:

  1. Add prefix: and suffix: kwargs to configure_file()

  2. Add a new token type #meson_dump_configuration (or similar) that can be put in config.h.meson that will dump the configuration_data() object in that place

The latter has the advantage of being more flexible, and the former has the advantage of having all the defines in one place (in meson.build).

Contributor Guide