mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-29 21:18:02 +00:00
[#3731] Some improvements
This commit is contained in:
parent
e36bace313
commit
5cc26b6bf0
77
meson.build
77
meson.build
@ -26,6 +26,21 @@ TEST_CA_DIR = f'@TOP_SOURCE_DIR@/src/lib/asiolink/testutils/ca'
|
|||||||
DATABASE_SCRIPTS_DIR = f'@TOP_BUILD_DIR@/src/share/database/scripts'
|
DATABASE_SCRIPTS_DIR = f'@TOP_BUILD_DIR@/src/share/database/scripts'
|
||||||
LEGAL_LOG_DIR = f'@PREFIX@/@RUN_STATE_DIR@/lib/kea'
|
LEGAL_LOG_DIR = f'@PREFIX@/@RUN_STATE_DIR@/lib/kea'
|
||||||
|
|
||||||
|
#### Build Options
|
||||||
|
|
||||||
|
all_opt = get_option('all')
|
||||||
|
crypto_opt = get_option('crypto')
|
||||||
|
gtest_opt = get_option('gtest')
|
||||||
|
krb5_opt = get_option('krb5')
|
||||||
|
mysql_opt = get_option('mysql')
|
||||||
|
netconf_opt = get_option('netconf')
|
||||||
|
postgresql_opt = get_option('postgresql')
|
||||||
|
|
||||||
|
logger_checks_opt = get_option('logger-checks')
|
||||||
|
FUZZ_OPT = get_option('fuzz')
|
||||||
|
PERFDHCP_OPT = get_option('perfdhcp')
|
||||||
|
SHELL_OPT = get_option('shell')
|
||||||
|
|
||||||
#### Configuration Data
|
#### Configuration Data
|
||||||
|
|
||||||
conf_data = configuration_data(
|
conf_data = configuration_data(
|
||||||
@ -172,7 +187,10 @@ boost = dependency('boost', version: '>=1.66')
|
|||||||
threads = dependency('threads')
|
threads = dependency('threads')
|
||||||
add_project_dependencies(boost, threads, language: ['cpp'])
|
add_project_dependencies(boost, threads, language: ['cpp'])
|
||||||
|
|
||||||
gtest = dependency('gtest', required: false)
|
gtest = disabler()
|
||||||
|
if gtest_opt == 'enabled'
|
||||||
|
gtest = dependency('gtest', required: true)
|
||||||
|
endif
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
log4cplus = dependency('log4cplus', required: false)
|
log4cplus = dependency('log4cplus', required: false)
|
||||||
@ -320,26 +338,12 @@ foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp']
|
|||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
#### Build Options
|
# Kea shell
|
||||||
|
|
||||||
all_opt = get_option('all')
|
|
||||||
crypto_opt = get_option('crypto')
|
|
||||||
gtest_opt = get_option('gtest')
|
|
||||||
krb5_opt = get_option('krb5')
|
|
||||||
mysql_opt = get_option('mysql')
|
|
||||||
netconf_opt = get_option('netconf')
|
|
||||||
postgresql_opt = get_option('postgresql')
|
|
||||||
|
|
||||||
# docs_opt = get_option('docs')
|
|
||||||
# parser_opt = get_option('parser')
|
|
||||||
|
|
||||||
FUZZ_OPT = get_option('fuzz')
|
|
||||||
PERFDHCP_OPT = get_option('perfdhcp')
|
|
||||||
SHELL_OPT = get_option('shell')
|
|
||||||
if SHELL_OPT == 'enabled' and not PYTHON.found()
|
if SHELL_OPT == 'enabled' and not PYTHON.found()
|
||||||
error('kea-shell requires python. Python not found.')
|
error('kea-shell requires python. Python not found.')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Crypto
|
||||||
if crypto_opt == 'botan'
|
if crypto_opt == 'botan'
|
||||||
if botan.found()
|
if botan.found()
|
||||||
crypto = botan
|
crypto = botan
|
||||||
@ -362,12 +366,8 @@ else
|
|||||||
error('Dependency not found: neither Botan nor OpenSSL.')
|
error('Dependency not found: neither Botan nor OpenSSL.')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# All option.
|
||||||
if all_opt.enabled()
|
if all_opt.enabled()
|
||||||
if gtest_opt == 'disabled'
|
|
||||||
gtest = disabler()
|
|
||||||
elif not gtest.found()
|
|
||||||
error('Dependency not found: GTest.')
|
|
||||||
endif
|
|
||||||
if krb5_opt == 'disabled'
|
if krb5_opt == 'disabled'
|
||||||
krb5 = disabler()
|
krb5 = disabler()
|
||||||
elif not krb5.found()
|
elif not krb5.found()
|
||||||
@ -398,9 +398,6 @@ if all_opt.enabled()
|
|||||||
SHELL_OPT = 'enabled'
|
SHELL_OPT = 'enabled'
|
||||||
endif
|
endif
|
||||||
elif all_opt.disabled()
|
elif all_opt.disabled()
|
||||||
if gtest_opt != 'enabled'
|
|
||||||
gtest = disabler()
|
|
||||||
endif
|
|
||||||
if krb5_opt != 'enabled'
|
if krb5_opt != 'enabled'
|
||||||
krb5 = disabler()
|
krb5 = disabler()
|
||||||
endif
|
endif
|
||||||
@ -423,10 +420,6 @@ elif all_opt.disabled()
|
|||||||
SHELL_OPT = 'disabled'
|
SHELL_OPT = 'disabled'
|
||||||
endif
|
endif
|
||||||
elif all_opt.auto()
|
elif all_opt.auto()
|
||||||
if gtest_opt == 'enabled' and not gtest.found()
|
|
||||||
error('Dependency not found: GTest.')
|
|
||||||
endif
|
|
||||||
|
|
||||||
if krb5_opt == 'enabled' and not krb5.found()
|
if krb5_opt == 'enabled' and not krb5.found()
|
||||||
error('Dependency not found: Kerberos 5 with GSSAPI.')
|
error('Dependency not found: Kerberos 5 with GSSAPI.')
|
||||||
endif
|
endif
|
||||||
@ -461,6 +454,10 @@ if postgresql.found()
|
|||||||
conf_data.set('HAVE_PGSQL', true)
|
conf_data.set('HAVE_PGSQL', true)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if logger_checks_opt == 'enabled'
|
||||||
|
conf_data.set('ENABLE_LOGGER_CHECKS', true)
|
||||||
|
endif
|
||||||
|
|
||||||
#### Compiler Checks
|
#### Compiler Checks
|
||||||
|
|
||||||
result = cpp.run(
|
result = cpp.run(
|
||||||
@ -541,15 +538,21 @@ else
|
|||||||
add_project_link_arguments(link_arg, language: 'cpp')
|
add_project_link_arguments(link_arg, language: 'cpp')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
have_premium = fs.is_dir('premium')
|
# Use dependencies as meson format -r does not traverse subdir with if_found.
|
||||||
if have_premium
|
if fs.is_dir('premium')
|
||||||
|
premium = declare_dependency()
|
||||||
conf_data.set('PREMIUM', 'yes')
|
conf_data.set('PREMIUM', 'yes')
|
||||||
conf_data.set('PREMIUM_EXTENDED_VERSION', f'"@PROJECT_VERSION@"')
|
conf_data.set('PREMIUM_EXTENDED_VERSION', f'"@PROJECT_VERSION@"')
|
||||||
else
|
else
|
||||||
|
premium = disabler()
|
||||||
conf_data.set('PREMIUM', 'no')
|
conf_data.set('PREMIUM', 'no')
|
||||||
conf_data.set('PREMIUM_EXTENDED_VERSION', '"no"')
|
conf_data.set('PREMIUM_EXTENDED_VERSION', '"no"')
|
||||||
endif
|
endif
|
||||||
have_contrib = fs.is_dir('contrib')
|
if fs.is_dir('contrib')
|
||||||
|
contrib = declare_dependency()
|
||||||
|
else
|
||||||
|
contrib = disabler()
|
||||||
|
endif
|
||||||
|
|
||||||
#### Default Includes
|
#### Default Includes
|
||||||
|
|
||||||
@ -572,7 +575,7 @@ report_conf_data.set('PACKAGE_VERSION_TYPE', 'development')
|
|||||||
report_conf_data.set('OS_TYPE', OS_TYPE)
|
report_conf_data.set('OS_TYPE', OS_TYPE)
|
||||||
report_conf_data.set('PREFIX', PREFIX)
|
report_conf_data.set('PREFIX', PREFIX)
|
||||||
report_conf_data.set('HOOKS_DIR', DEFAULT_HOOKS_PATH)
|
report_conf_data.set('HOOKS_DIR', DEFAULT_HOOKS_PATH)
|
||||||
if have_premium
|
if premium.found()
|
||||||
report_conf_data.set('PREMIUM', 'yes')
|
report_conf_data.set('PREMIUM', 'yes')
|
||||||
else
|
else
|
||||||
report_conf_data.set('PREMIUM', 'no')
|
report_conf_data.set('PREMIUM', 'no')
|
||||||
@ -883,12 +886,8 @@ subdir('tools')
|
|||||||
subdir('src')
|
subdir('src')
|
||||||
subdir('fuzz')
|
subdir('fuzz')
|
||||||
subdir('doc')
|
subdir('doc')
|
||||||
if have_premium
|
subdir('premium', if_found: premium)
|
||||||
subdir('premium')
|
subdir('contrib', if_found: contrib)
|
||||||
endif
|
|
||||||
if have_contrib
|
|
||||||
subdir('contrib')
|
|
||||||
endif
|
|
||||||
|
|
||||||
#### More Custom Targets
|
#### More Custom Targets
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ option(
|
|||||||
# Dependency-related options
|
# Dependency-related options
|
||||||
option('crypto', type: 'combo', choices: ['botan', 'openssl'], value: 'openssl', description: 'Backend for cryptographical operations. Mandatory.')
|
option('crypto', type: 'combo', choices: ['botan', 'openssl'], value: 'openssl', description: 'Backend for cryptographical operations. Mandatory.')
|
||||||
option('krb5', type: 'combo', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for GSS-TSIG. Requires krb5 with gssapi.')
|
option('krb5', type: 'combo', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for GSS-TSIG. Requires krb5 with gssapi.')
|
||||||
option('gtest', type: 'combo', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for unit tests with GTest.')
|
|
||||||
option('mysql', type: 'combo', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for MySQL backends.')
|
option('mysql', type: 'combo', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for MySQL backends.')
|
||||||
option('netconf', type: 'combo', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for kea-netconf.')
|
option('netconf', type: 'combo', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for kea-netconf.')
|
||||||
option('postgresql', type: 'combo', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for PostgreSQL backends.')
|
option('postgresql', type: 'combo', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for PostgreSQL backends.')
|
||||||
@ -19,8 +18,11 @@ option('postgresql', type: 'combo', choices: ['', 'auto', 'enabled', 'disabled']
|
|||||||
# option('parser', type: 'feature', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for parser generation.')
|
# option('parser', type: 'feature', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for parser generation.')
|
||||||
|
|
||||||
# Options for enabling various parts of code.
|
# Options for enabling various parts of code.
|
||||||
|
# not only unit tests...
|
||||||
|
option('gtest', type: 'combo', choices: ['enabled', 'disabled'], value: 'disabled', description: 'Support for tests.')
|
||||||
# debug?
|
# debug?
|
||||||
# logger-checks?
|
# logger-checks (uses assert so only for development).
|
||||||
|
option('logger-checks', type: 'combo', choices: ['enabled', 'disabled'], value: 'disabled', description: 'Check logger messages.')
|
||||||
option('fuzz', type: 'combo', choices: ['', 'auto', 'clusterfuzzlite', 'disabled', 'enabled'], value: '', description: 'Support for fuzz testing.')
|
option('fuzz', type: 'combo', choices: ['', 'auto', 'clusterfuzzlite', 'disabled', 'enabled'], value: '', description: 'Support for fuzz testing.')
|
||||||
option('perfdhcp', type: 'combo', choices: ['', 'auto', 'disabled', 'enabled'], value: '', description: 'Builds perfdhcp.')
|
option('perfdhcp', type: 'combo', choices: ['', 'auto', 'disabled', 'enabled'], value: '', description: 'Builds perfdhcp.')
|
||||||
option('shell', type: 'combo', choices: ['', 'auto', 'disabled', 'enabled'], value: '', description: 'Builds kea-shell.')
|
option('shell', type: 'combo', choices: ['', 'auto', 'disabled', 'enabled'], value: '', description: 'Builds kea-shell.')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user