Skip to content

Generated header files from configure_data being in quotes #12516

Answered by eli-schwartz
dsommers asked this question in Q&A
Discussion options

You must be logged in to vote
build_cfg = configuration_data()

build_cfg.set_quoted(
    'USERNAME', get_option('username'),
    description: 'default username for the process',
)

The set_quoted method is designed to handle the nitty-gritty of converting a string to something that the compiler treats as an appropriately defined string value. It also has an optional kwarg that adds a descriptive comment to the header file (autotools' autoheader does something similar).

This doesn't work as an inlined value. You need to build the configuration object and then use the utility setters.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dsommers
Comment options

Answer selected by dsommers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants