mirror of
https://github.com/rizinorg/rizin
synced 2026-08-22 20:26:16 -04:00
Build: add option to choose to regenerate cmd_descs.[ch] (#2934)
This commit is contained in:
parent
c542bfcb4a
commit
d1feb6cea3
2 changed files with 6 additions and 1 deletions
|
|
@ -32,13 +32,17 @@ cmd_descs_yaml = files(
|
|||
cmd_descs_src_c = files('cmd_descs.c', 'cmd_descs.h')
|
||||
|
||||
r = run_command(py3_exe, '-c', 'import yaml', check: false)
|
||||
if r.returncode() == 0
|
||||
cmd_option = get_option('regenerate_cmds')
|
||||
has_pyyaml = r.returncode() == 0
|
||||
if (cmd_option.auto() or cmd_option.enabled()) and has_pyyaml
|
||||
cmd_descs_ch = custom_target(
|
||||
'cmd_descs.[ch]',
|
||||
output: ['cmd_descs.c', 'cmd_descs.h'],
|
||||
input: cmd_descs_yaml,
|
||||
command: [py3_exe, cmd_descs_generate_py, '--output-dir', '@OUTDIR@', '--src-output-dir', meson.current_source_dir(), '@INPUT@']
|
||||
)
|
||||
elif cmd_option.enabled() and not has_pyyaml
|
||||
error('PyYAML python module was not found, but it is required to regenerate cmd_descs.[ch]')
|
||||
else
|
||||
warning('PyYAML python module was not found, using cmd_descs.c/cmd_descs.h from source directory. Install PyYAML (either from your package manager or through pip) if you need to modify cmd_descs files.')
|
||||
cmd_descs_ch = cmd_descs_src_c
|
||||
|
|
|
|||
|
|
@ -39,3 +39,4 @@ option('debugger', type: 'boolean', value: true)
|
|||
|
||||
option('enable_tests', type: 'boolean', value: true, description: 'Build unit tests in test/unit')
|
||||
option('enable_rz_test', type: 'boolean', value: true, description: 'Build rz-test executable for regression testing')
|
||||
option('regenerate_cmds', type: 'feature', value: 'auto', description: 'Regenerate the cmd_descs.[ch] files (requires PyYAML)')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue