Use -Dcompat_cli=false to reduce the install size by over 100Kb

We don't need these binaries for green-field projects.
This commit is contained in:
Richard Hughes 2021-11-13 08:43:55 +00:00
parent 64d1a01d42
commit 49afe450ab
4 changed files with 9 additions and 2 deletions

View File

@ -51,3 +51,4 @@ option('metainfo', type: 'boolean', value : true, description : 'install the pro
option('bash_completion', type: 'boolean', value : true, description : 'enable bash completion') option('bash_completion', type: 'boolean', value : true, description : 'enable bash completion')
option('fish_completion', type: 'boolean', value : true, description : 'enable fish completion') option('fish_completion', type: 'boolean', value : true, description : 'enable fish completion')
option('offline', type: 'boolean', value : true, description : 'enable installing firmware using a pre-boot systemd target') option('offline', type: 'boolean', value : true, description : 'enable installing firmware using a pre-boot systemd target')
option('compat_cli', type: 'boolean', value : true, description : 'enable legacy commands: fwupdagent,dfu-tool,fwupdate')

View File

@ -56,6 +56,7 @@ shared_module('fu_plugin_dfu',
], ],
) )
if get_option('compat_cli')
fu_dfu_tool = executable( fu_dfu_tool = executable(
'dfu-tool', 'dfu-tool',
fu_hash, fu_hash,
@ -79,8 +80,9 @@ fu_dfu_tool = executable(
install : true, install : true,
install_dir : bindir install_dir : bindir
) )
endif
if get_option('man') if get_option('compat_cli') and get_option('man')
configure_file( configure_file(
input : 'dfu-tool.1', input : 'dfu-tool.1',
output : 'dfu-tool.1', output : 'dfu-tool.1',

View File

@ -64,6 +64,7 @@ shared_module('fu_plugin_uefi_capsule',
], ],
) )
if get_option('compat_cli')
fwupdate = executable( fwupdate = executable(
'fwupdate', 'fwupdate',
resources_src, resources_src,
@ -100,8 +101,9 @@ fwupdate = executable(
install_dir : bindir, install_dir : bindir,
c_args : cargs, c_args : cargs,
) )
endif
if get_option('man') if get_option('compat_cli') and get_option('man')
configure_file( configure_file(
input : 'fwupdate.1', input : 'fwupdate.1',
output : 'fwupdate.1', output : 'fwupdate.1',

View File

@ -100,12 +100,14 @@ fwupdmgr = executable(
) )
# for compatibility # for compatibility
if get_option('compat_cli')
meson.add_install_script( meson.add_install_script(
'sh', '-c', 'sh', '-c',
'ln -fs fwupdmgr @0@@1@'.format( 'ln -fs fwupdmgr @0@@1@'.format(
'${DESTDIR}', '${DESTDIR}',
join_paths(get_option('prefix'), get_option('bindir'), 'fwupdagent'))) join_paths(get_option('prefix'), get_option('bindir'), 'fwupdagent')))
endif endif
endif
if get_option('systemd') and get_option('offline') if get_option('systemd') and get_option('offline')
fwupdoffline = executable( fwupdoffline = executable(