Convert meson dictionary or object from configuration_data() to json string #13655
-
This how I generate my dictionary:
I'm looking a way to pass the cfg_data as json string to my script:
I try to use it in a run_target but:
Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I would try using https://mesonbuild.com/Reference-manual_functions.html#configure_file_output_format Since meson 1.3.0, |
Beta Was this translation helpful? Give feedback.
-
Instead of json, if you only have two values you could pass them as values to the script, like: command: [
PYTHON_EXECUTABLE,
SCRIPTS.get(6), # configure_file.py
data_sources.get(0),
'kakakaka.txt',
'--program-name', PROGRAM_NAME,
'--program-title', PROGRAM_TITLE,
] |
Beta Was this translation helpful? Give feedback.
I would try using https://mesonbuild.com/Reference-manual_functions.html#configure_file_output_format
Since meson 1.3.0,
configure_file(output: 'data.json', configuration: cfg_data, output_format: 'json')
can be used to configure a json file instead of a C header