From c696220f97ebc9a72adcb2b56e70ba706a7d88f3 Mon Sep 17 00:00:00 2001 From: Thomas Heijligen Date: Sat, 13 Aug 2022 12:42:05 +0200 Subject: meson: Build the classic cli / flashrom cli executable as feature Provide the meson option `-Dclassic_cli=auto/enabled/disabled` to determine if the classic cli flashrom executable should be built. This is needed to support targets, like libpayload, which can only build libflashrom. Change-Id: If39981ad0b3281edd6fc7e220362d2938dddf814 Signed-off-by: Thomas Heijligen Reviewed-on: https://review.coreboot.org/c/flashrom/+/66705 Reviewed-by: Anastasia Klimchuk Reviewed-by: Felix Singer Tested-by: build bot (Jenkins) --- meson.build | 28 +++++++++++++++------------- meson_options.txt | 1 + 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/meson.build b/meson.build index 366ce18a..634e6270 100644 --- a/meson.build +++ b/meson.build @@ -478,19 +478,21 @@ configure_file( install_dir: join_paths(get_option('mandir'), 'man8'), ) -executable( - 'flashrom', - files( - 'cli_classic.c', - 'cli_common.c', - 'cli_output.c', - ), - c_args : cargs, - include_directories : include_dir, - install : true, - install_dir : get_option('sbindir'), - link_with : libflashrom.get_static_lib(), # flashrom needs internal symbols of libflashrom -) +if get_option('classic_cli').auto() or get_option('classic_cli').enabled() + executable( + 'flashrom', + files( + 'cli_classic.c', + 'cli_common.c', + 'cli_output.c', + ), + c_args : cargs, + include_directories : include_dir, + install : true, + install_dir : get_option('sbindir'), + link_with : libflashrom.get_static_lib(), # flashrom needs internal symbols of libflashrom + ) +endif if get_option('ich_descriptors_tool').auto() or get_option('ich_descriptors_tool').enabled() subdir('util/ich_descriptors_tool') diff --git a/meson_options.txt b/meson_options.txt index 284bfba9..850505d4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,5 +1,6 @@ option('pciutils', type : 'boolean', value : true, description : 'use pciutils') option('usb', type : 'boolean', value : true, description : 'use libusb1') +option('classic_cli', type : 'feature', value : 'enabled', description : 'classic flashrom cli binary') option('print_wiki', type : 'boolean', value : true, description : 'Print Wiki') option('default_programmer_name', type : 'string', description : 'default programmer') option('default_programmer_args', type : 'string', description : 'default programmer arguments') -- cgit v1.2.3