Clean up meson summary
Make the meson summary better by:
Adding new sections for each value type (this implicitly sorts each
section, making the pattern more clear)
Remove the generated messon message, where we print the values of
ifdefs.
Enable bool_yn for feature options, which allows us to pass the feature
in directly, and print and colorize yes/no answers
Tested: meson setup builddir
Results in no messages printed for the ifdefs, and colorized output,
with yes/no answers, summarized below.
Feature Options
basic-auth : YES
String Options
dns-resolver : systemd-dbus
Numeric Options
http-body-limit : 30
Change-Id: I13f003846edaa355090c14113b61aacb05cbeb9a
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/config/meson.build b/config/meson.build
index e681a5f..efa9cca 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -52,26 +52,44 @@
int_options = ['http-body-limit', 'watchdog-timeout-seconds']
-feature_options_string = '\n//Feature options\n'
+feature_options_string = '\n// Feature options\n'
string_options_string = '\n// String options\n'
int_options_string = '\n// Integer options\n'
-foreach option_key : feature_options + string_options + int_options
- option_key_config = 'BMCWEB_' + option_key.to_upper()
- option_key_config = option_key_config.replace('-', '_')
- message(option_key_config)
+foreach feature_type, feature_list : {
+ 'Feature': feature_options,
+ 'Numeric': int_options,
+ 'String': string_options,
+}
+ summary_dict = {}
+ foreach option_key : feature_list
+ option_key_config = 'BMCWEB_' + option_key.to_upper()
+ option_key_config = option_key_config.replace('-', '_')
- opt = get_option(option_key)
- if string_options.contains(option_key)
- string_options_string += 'constexpr std::string_view ' + option_key_config + ' = "' + opt + '";\n'
- elif int_options.contains(option_key)
- int_options_string += 'constexpr const int ' + option_key_config + ' = ' + opt.to_string() + ';\n'
- else
- feature_options_string += 'constexpr const bool ' + option_key_config + ' = ' + opt.allowed().to_string() + ';\n'
- opt = opt.allowed().to_string()
- endif
- summary(option_key, opt, section: 'Features')
+ opt = get_option(option_key)
+ if feature_type == 'Feature'
+ opt = opt.allowed()
+ feature_options_string += 'constexpr const bool @0@=@1@;\n'.format(
+ option_key_config,
+ opt.to_string(),
+ )
+ endif
+ if feature_type == 'Numeric'
+ int_options_string += 'constexpr const int @0@=@1@;\n'.format(
+ option_key_config,
+ opt.to_string(),
+ )
+ endif
+ if feature_type == 'String'
+ string_options_string += 'constexpr std::string_view @0@="@1@";\n'.format(
+ option_key_config,
+ opt,
+ )
+ endif
+ summary_dict += {option_key: opt}
+ endforeach
+ summary(summary_dict, section: feature_type + ' Options', bool_yn: true)
endforeach
# Logging level
@@ -84,7 +102,7 @@
string_options_string += 'constexpr std::string_view BMCWEB_LOGGING_LEVEL' + ' = "' + loglvlopt + '";\n'
# NBD proxy is disabled due to lack of maintenance. See meson_options.txt
-feature_options_string += 'constexpr const bool BMCWEB_VM_NBDPROXY = false;\n'
+feature_options_string += 'constexpr const bool BMCWEB_VM_NBDPROXY = false;\n'
conf_data.set(
'BMCWEB_OPTIONS',