summaryrefslogtreecommitdiff
path: root/config/meson.build
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2024-05-08 02:37:09 +0300
committerEd Tanous <ed@tanous.net>2024-05-20 22:37:06 +0300
commitfe907df460896297eb8b1fde00a18dd7cccab109 (patch)
tree93075a8853814ee480a05fc64f6de40b8ed12ce1 /config/meson.build
parente518ef320280c4a5e372e15eef86546e483f4f3d (diff)
downloadbmcweb-fe907df460896297eb8b1fde00a18dd7cccab109.tar.xz
Remove options from configure file
Ideally, we should only have to declare meson options in one place, in the meson_options.txt, and have all files generate from that list. This patchset gets us one step closer, where we have to list options in 2 places, whereas previously it was 3. Tested: Code compiles. Manual inspection of generated bmcweb_config.h shows only minor differences in generated file. Change-Id: I4a4f863c95463e3cdf8b629de5a0a73f74cf001e Signed-off-by: Ed Tanous <ed@tanous.net>
Diffstat (limited to 'config/meson.build')
-rw-r--r--config/meson.build41
1 files changed, 24 insertions, 17 deletions
diff --git a/config/meson.build b/config/meson.build
index 9f66d0eaa4..887c48d495 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -5,13 +5,10 @@ conf_data = configuration_data()
feature_options = [
'basic-auth',
'cookie-auth',
- 'dns-resolver',
'experimental-http2',
'experimental-redfish-multi-computer-system',
'google-api',
'host-serial-socket',
- 'http-body-limit',
- 'https_port',
'ibm-management-console',
'insecure-disable-auth',
'insecure-disable-csrf',
@@ -22,7 +19,6 @@ feature_options = [
'insecure-tftp-update',
'kvm',
'mutual-tls-auth',
- 'mutual-tls-common-name-parsing',
'redfish-aggregation',
'redfish-allow-deprecated-power-thermal',
'redfish-bmc-journal',
@@ -50,30 +46,30 @@ string_options = [
int_options = [
'http-body-limit',
- 'https_port',
]
-foreach option_key : feature_options
+feature_options_string = '\n//Feature options\n'
+string_options_string = '\n// String options\n'
+int_options_string = '\n// Integer options\n'
- option_key_config = option_key.to_upper()
+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)
+
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
- conf_data.set(option_key_config, opt)
summary(option_key, opt, section: 'Features')
endforeach
-conf_data.set('MESON_INSTALL_PREFIX', get_option('prefix'))
-
-conf_data.set10('BMCWEB_VIRTUAL_MEDIA_VM', get_option('vm-websocket').allowed())
-conf_data.set10('BMCWEB_VIRTUAL_MEDIA_NBD', false)
-
# Logging level
loglvlopt = get_option('bmcweb-logging')
if get_option('buildtype').startswith('debug') and loglvlopt == 'disabled'
@@ -81,7 +77,15 @@ if get_option('buildtype').startswith('debug') and loglvlopt == 'disabled'
loglvlopt = 'debug'
endif
loglvlopt = loglvlopt.to_upper()
-conf_data.set('LOGGING_LEVEL', loglvlopt)
+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'
+
+conf_data.set(
+ 'BMCWEB_OPTIONS',
+ string_options_string + int_options_string + feature_options_string,
+)
conf_h_dep = declare_dependency(
include_directories: include_directories('.'),
@@ -93,21 +97,24 @@ conf_h_dep = declare_dependency(
)
# Configure and install systemd unit files
-
configure_file(
input: 'bmcweb.socket.in',
output: 'bmcweb.socket',
install_dir: systemd_system_unit_dir,
- configuration: conf_data,
install: true,
+ configuration: configuration_data({
+ 'BMCWEB_HTTPS_PORT': get_option('https_port'),
+ }),
)
configure_file(
input: 'bmcweb.service.in',
output: 'bmcweb.service',
install_dir: systemd_system_unit_dir,
- configuration: conf_data,
install: true,
+ configuration: configuration_data({
+ 'MESON_INSTALL_PREFIX': get_option('prefix'),
+ }),
)
# Copy pam-webserver to etc/pam.d