diff --git a/compiler-checks/fuzzing-with-clusterfuzzlite.cc b/compiler-checks/fuzzing-with-clusterfuzzlite.cc new file mode 100644 index 0000000000..6346e2d268 --- /dev/null +++ b/compiler-checks/fuzzing-with-clusterfuzzlite.cc @@ -0,0 +1,3 @@ +int main() { + return 1; +} diff --git a/fuzz/meson.build b/fuzz/meson.build index 8336636a56..4d7c6aa116 100644 --- a/fuzz/meson.build +++ b/fuzz/meson.build @@ -1,4 +1,4 @@ -if FUZZ_OPT != 'enabled' +if not FUZZ_OPT.enabled() subdir_done() endif @@ -10,7 +10,7 @@ cpp_flags = [ f'-DKEA_LFC_SOURCES="@KEA_LFC@"', f'-DKEA_LFC_INSTALLATION="@PREFIX@/sbin/kea-lfc"', ] -if FUZZ_OPT == 'clusterfuzzlite' +if FUZZING_WITH_CLUSTERFUZZLITE cpp_flags = ['-fsanitize=fuzzer', '-gdwarf-4'] else fuzz_sources += ['main.cc'] @@ -22,7 +22,7 @@ fuzz_lib = static_library( 'fuzz_lib', fuzz_sources, cpp_args: cpp_flags, - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: includes, link_with: LIBS_BUILT_SO_FAR, ) @@ -32,7 +32,7 @@ executable( 'fuzz_config_kea_dhcp4.cc', fuzz_sources, cpp_args: cpp_flags, - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: includes, link_with: [dhcp4_lib, fuzz_lib] + LIBS_BUILT_SO_FAR, ) @@ -42,7 +42,7 @@ executable( 'fuzz_config_kea_dhcp6.cc', fuzz_sources, cpp_args: cpp_flags, - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: includes, link_with: [dhcp6_lib, fuzz_lib] + LIBS_BUILT_SO_FAR, ) @@ -52,7 +52,7 @@ executable( 'fuzz_http_endpoint_kea_dhcp4.cc', fuzz_sources, cpp_args: cpp_flags, - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: includes, link_with: [dhcp4_lib, fuzz_lib] + LIBS_BUILT_SO_FAR, ) @@ -62,7 +62,7 @@ executable( 'fuzz_http_endpoint_kea_dhcp6.cc', fuzz_sources, cpp_args: cpp_flags, - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: includes, link_with: [dhcp6_lib, fuzz_lib] + LIBS_BUILT_SO_FAR, ) @@ -72,7 +72,7 @@ executable( 'fuzz_packets_kea_dhcp4.cc', fuzz_sources, cpp_args: cpp_flags, - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: includes, link_with: [dhcp4_lib, kea_dhcpsrv_lib, fuzz_lib] + LIBS_BUILT_SO_FAR, ) @@ -82,7 +82,7 @@ executable( 'fuzz_packets_kea_dhcp6.cc', fuzz_sources, cpp_args: cpp_flags, - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: includes, link_with: [dhcp6_lib, kea_dhcpsrv_lib, fuzz_lib] + LIBS_BUILT_SO_FAR, ) @@ -92,7 +92,7 @@ executable( 'fuzz_unix_socket_kea_dhcp4.cc', fuzz_sources, cpp_args: cpp_flags, - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: includes, link_with: [dhcp4_lib, kea_testutils_lib, fuzz_lib] + LIBS_BUILT_SO_FAR, ) @@ -102,7 +102,7 @@ executable( 'fuzz_unix_socket_kea_dhcp6.cc', fuzz_sources, cpp_args: cpp_flags, - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: includes, link_with: [dhcp6_lib, kea_testutils_lib, fuzz_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/meson.build b/meson.build index 3d21739da6..ccd3da9e25 100644 --- a/meson.build +++ b/meson.build @@ -28,9 +28,7 @@ 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') @@ -38,8 +36,8 @@ 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') +TESTS_OPT = get_option('tests') #### Configuration Data @@ -47,7 +45,6 @@ conf_data = configuration_data( { # 'CONFIG_H_WAS_INCLUDED': true, # 'ENABLE_DEBUG': false, - # 'ENABLE_LOGGER_CHECKS': false, 'EXTENDED_VERSION': '"tarball"', # 'HAS_UNDEFINED_PTHREAD_BEHAVIOR': false, # 'HAVE_AFL': false, @@ -85,7 +82,6 @@ conf_data = configuration_data( # 'HAVE_LOG': false, # 'HAVE_MYSQL_GET_OPTION': false, # 'HAVE_MYSQL_OPT_RECONNECT': false, - # 'HAVE_NETCONF': false, # 'HAVE_OPTRESET': false, # 'HAVE_PGSQL_SSL': false, # 'HAVE_PGSQL_TCP_USER_TIMEOUT': false, @@ -183,27 +179,16 @@ KEA_MSG_COMPILER = disabler() #### Dependencies -boost = dependency('boost', version: '>=1.66') -threads = dependency('threads') -add_project_dependencies(boost, threads, language: ['cpp']) - -gtest = disabler() -if gtest_opt == 'enabled' - gtest = dependency('gtest', required: true) -endif +boost_dep = dependency('boost', version: '>=1.66') +threads_dep = dependency('threads') +add_project_dependencies(boost_dep, threads_dep, language: ['cpp']) # Logging -log4cplus = dependency('log4cplus', required: false) -# TODO: leave only dependecy() when support for Ubuntu 20.04 gets removed. -if not log4cplus.found() - log4cplus = cpp.find_library('log4cplus', required: false) -endif -if not log4cplus.found() - error('Dependency not found: log4cplus.') -endif +# TODO: remove fallback when support for Ubuntu 20.04 gets removed. +LOG4CPLUS_DEP = dependency('log4cplus', fallback: ['log4cplus', 'log4cplus']) # Cryptography -crypto = disabler() +CRYPTO_DEP = disabler() botan = disabler() foreach dep : ['botan-2', 'botan'] botan = dependency(dep, required: false) @@ -214,256 +199,79 @@ endforeach openssl = dependency('openssl', required: false) # Kerberos -krb5 = disabler() -krb5_config = find_program('krb5-config', required: false) -if krb5_config.found() - cflags = run_command([krb5_config, '--cflags', 'gssapi'], check: false) - libs = run_command([krb5_config, '--libs', 'gssapi'], check: false) - version = run_command([krb5_config, '--version'], check: false) - if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0 - krb5_version = version.stdout().strip() - krb5 = declare_dependency( - compile_args: cflags.stdout().split(), - link_args: libs.stdout().split(), - version: krb5_version, - ) - endif -endif -if not krb5.found() - krb5 = dependency('krb5', required: false) -endif +KRB5_DEP = dependency( + 'krb5-gssapi', + fallback: ['krb5', 'krb5'], + required: krb5_opt, +) # MySQL -mysql = dependency('mariadb', required: false) -if not mysql.found() - mysql = dependency('mysql', required: false) -endif -mysql_config = disabler() -foreach mysql_config_file : ['mariadb_config', 'mysql_config'] - if mysql.found() - continue - endif - mysql_config = find_program(mysql_config_file, required: false) - if not mysql_config.found() - continue - endif - cflags = run_command([mysql_config, '--cflags'], check: false) - libs = run_command([mysql_config, '--libs'], check: false) - version = run_command([mysql_config, '--version'], check: false) - - if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0 - mysql_compile_args = cflags.stdout().split() - mysql_link_args = libs.stdout().split() - mysql_version = version.stdout().strip() - mysql = declare_dependency( - compile_args: mysql_compile_args, - link_args: mysql_link_args, - version: mysql_version, - ) - break - endif -endforeach +MYSQL_DEP = dependency( + 'mariadb', + fallback: ['mysql', 'mysql'], + required: mysql_opt, +) # PostgreSQL -postgresql = dependency('libpq', required: false) -pg_config = disabler() -if not postgresql.found() - pg_config = find_program('pg_config', required: false) -endif -if pg_config.found() - cflags = run_command([pg_config, '--cflags'], check: false) - libs = run_command([pg_config, '--libs'], check: false) - version = run_command([pg_config, '--version'], check: false) - if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0 - pgsql_compile_args = cflags.stdout().split() - pgsql_link_args = libs.stdout().split() - pgsql_version = version.stdout().strip() - postgresql = declare_dependency( - compile_args: pgsql_compile_args, - link_args: pgsql_link_args, - version: pgsql_version, - ) - endif -endif +POSTGRESQL_DEP = dependency( + 'libpq', + fallback: ['postgresql', 'postgresql'], + required: postgresql_opt, +) # NETCONF -netconf_deps = {} -NETCONF_DEPS_ARRAY = [] -NETCONF_DEPS_FOUND = true -foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp'] - netconf_deps = netconf_deps + {dep: dependency(dep, required: false)} - if netconf_deps[dep].found() - continue - endif +NETCONF_DEP = dependency( + 'yang,yang-cpp,sysrepo,sysrepo-cpp', + fallback: ['netconf', 'netconf'], + required: netconf_opt, +) +if netconf_opt.enabled() and NETCONF_DEP.get_variable('libyang_prefix', default_value: 'unknown') == 'unknown' + error('Dependency not found: NETCONF.') +endif - # Try adding lib to it. libyang and libyang-cpp define the wrong pkg-config. - netconf_deps = netconf_deps + { - dep: dependency('lib' + dep, required: false), - } - if netconf_deps[dep].found() - continue - endif - - # Search in /opt. - foreach prefix : ['', 'lib'] - path = f'/opt/@prefix@@dep@' - lib = cpp.find_library(dep, dirs: [f'/@path@/lib'], required: false) - if lib.found() - netconf_deps = netconf_deps + { - dep: declare_dependency( - dependencies: [lib], - include_directories: include_directories(f'/@path@/include'), - variables: {'prefix': f'@path@'}, - ), - } - if SYSTEM == 'darwin' - add_project_link_arguments( - f'-Wl,-rpath,@path@/lib', - language: 'cpp', - ) - else - add_project_link_arguments( - f'-Wl,-rpath=@path@/lib', - language: 'cpp', - ) - endif - endif - endforeach -endforeach -foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp'] - if netconf_deps[dep].found() - NETCONF_DEPS_ARRAY += netconf_deps[dep] - else - NETCONF_DEPS_FOUND = false - endif -endforeach +GTEST_DEP = dependency( + 'gtest', + required: TESTS_OPT.enabled() or FUZZ_OPT.enabled(), +) # Kea 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.') endif # Crypto if crypto_opt == 'botan' if botan.found() - crypto = botan + CRYPTO_DEP = botan endif elif crypto_opt == 'openssl' if openssl.found() - crypto = openssl + CRYPTO_DEP = openssl endif endif -if crypto.name() == botan.name() +if CRYPTO_DEP.name() == botan.name() message('Checking Botan Boost support.') cpp.has_header('botan/asio_stream.h', dependencies: [botan], required: true) conf_data.set('WITH_BOTAN', true) message('Using Botan.') -elif crypto.name() == openssl.name() +elif CRYPTO_DEP.name() == openssl.name() conf_data.set('WITH_OPENSSL', true) message('Using OpenSSL.') else error('Dependency not found: neither Botan nor OpenSSL.') endif -# All option. -if all_opt.enabled() - if krb5_opt == 'disabled' - krb5 = disabler() - elif not krb5.found() - error('Dependency not found: Kerberos 5 with GSSAPI.') - endif - if mysql_opt == 'disabled' - mysql = disabler() - elif not mysql.found() - error('Dependency not found: MySQL.') - endif - if netconf_opt == 'disabled' - NETCONF_DEPS_FOUND = false - elif not NETCONF_DEPS_FOUND - error('Dependency not found: NETCONF.') - endif - if postgresql_opt == 'disabled' - postgresql = disabler() - elif not postgresql.found() - error('Dependency not found: PostgreSQL.') - endif - if FUZZ_OPT != 'disabled' - FUZZ_OPT = 'enabled' - endif - if PERFDHCP_OPT != 'disabled' - PERFDHCP_OPT = 'enabled' - endif - if SHELL_OPT != 'disabled' - SHELL_OPT = 'enabled' - endif -elif all_opt.disabled() - if krb5_opt != 'enabled' - krb5 = disabler() - endif - if mysql_opt != 'enabled' - mysql = disabler() - endif - if netconf_opt != 'enabled' - NETCONF_DEPS_FOUND = false - endif - if postgresql_opt != 'enabled' - postgresql = disabler() - endif - if FUZZ_OPT != 'enabled' - FUZZ_OPT = 'disabled' - endif - if PERFDHCP_OPT != 'enabled' - PERFDHCP_OPT = 'disabled' - endif - if SHELL_OPT != 'enabled' - SHELL_OPT = 'disabled' - endif -elif all_opt.auto() - if krb5_opt == 'enabled' and not krb5.found() - error('Dependency not found: Kerberos 5 with GSSAPI.') - endif - - if mysql_opt == 'enabled' and not mysql.found() - error('Dependency not found: MySQL.') - endif - - if netconf_opt == 'enabled' and not NETCONF_DEPS_FOUND - error('Dependency not found: NETCONF.') - endif - - if postgresql_opt == 'enabled' and not postgresql.found() - error('Dependency not found: PostgreSQL.') - endif -else - error('Unknown value for -Dall') -endif - -if FUZZ_OPT == 'enabled' - if not gtest.found() - error('Fuzzing requires gtest. Gtest not found.') - endif - conf_data.set('FUZZING', true) -endif - -if mysql.found() - conf_data.set('HAVE_MYSQL', true) -endif - -if postgresql.found() - conf_data.set('HAVE_PGSQL', true) -endif - -if logger_checks_opt == 'enabled' - conf_data.set('ENABLE_LOGGER_CHECKS', true) -endif +conf_data.set('ENABLE_LOGGER_CHECKS', logger_checks_opt.enabled()) +conf_data.set('FUZZING', FUZZ_OPT.enabled()) +conf_data.set('HAVE_MYSQL', MYSQL_DEP.found()) +conf_data.set('HAVE_PGSQL', POSTGRESQL_DEP.found()) #### Compiler Checks result = cpp.run( fs.read('compiler-checks/chrono-same-duration.cc'), name: 'CHRONO_SAME_DURATION', - dependencies: [boost], ) conf_data.set('CHRONO_SAME_DURATION', result.returncode() == 0) @@ -483,7 +291,7 @@ endif result = cpp.run( fs.read('compiler-checks/have-generic-tls-method.cc'), name: 'HAVE_GENERIC_TLS_METHOD', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], ) conf_data.set('HAVE_GENERIC_TLS_METHOD', result.returncode() == 0) @@ -499,15 +307,15 @@ conf_data.set('HAVE_SA_LEN', result.returncode() == 0) result = cpp.run( fs.read('compiler-checks/log4cplus-initializer.cc'), name: 'LOG4CPLUS_INITIALIZER_H', - dependencies: [log4cplus], + dependencies: [LOG4CPLUS_DEP], ) conf_data.set('LOG4CPLUS_INITIALIZER_H', result.returncode() == 0) -if mysql.found() +if MYSQL_DEP.found() result = cpp.run( fs.read('compiler-checks/mysql-my-bool.cc'), - name: 'HAVE_MYSQL_MY_BOOL', - dependencies: [mysql], + name: 'MYSQL_MY_BOOL', + dependencies: [MYSQL_DEP], ) conf_data.set('HAVE_MYSQL_MY_BOOL', result.returncode() == 0) endif @@ -515,10 +323,17 @@ endif result = cpp.run( fs.read('compiler-checks/stream-truncated-error.cc'), name: 'HAVE_STREAM_TRUNCATED_ERROR', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], ) conf_data.set('HAVE_STREAM_TRUNCATED_ERROR', result.returncode() == 0) +# TODO: implement when integrating with CI +result = cpp.run( + fs.read('compiler-checks/fuzzing-with-clusterfuzzlite.cc'), + name: 'FUZZING_WITH_CLUSTERFUZZLITE', +) +FUZZING_WITH_CLUSTERFUZZLITE = result.returncode() == 0 + #### System-specific Compiler Flags compile_args = [] @@ -623,7 +438,6 @@ endif result = cpp.run( fs.read('compiler-checks/get-boost-version.cc'), name: 'Get Boost version', - dependencies: [boost], ) if result.returncode() == 0 report_conf_data.set('BOOST_VERSION', result.stdout().strip()) @@ -632,38 +446,38 @@ else endif report_conf_data.set( 'BOOST_INCLUDE', - boost.get_variable('includedir', default_value: 'unknown'), + boost_dep.get_variable('includedir', default_value: 'unknown'), ) report_conf_data.set( 'BOOST_LIBDIR', - boost.get_variable('libdir', default_value: 'unknown'), + boost_dep.get_variable('libdir', default_value: 'unknown'), ) report_conf_data.set( 'CRYPTO_INCLUDE', - crypto.get_variable('includedir', default_value: 'unknown'), + CRYPTO_DEP.get_variable('includedir', default_value: 'unknown'), ) report_conf_data.set( 'CRYPTO_LIBDIR', - crypto.get_variable('libdir', default_value: 'unknown'), + CRYPTO_DEP.get_variable('libdir', default_value: 'unknown'), ) -if crypto.name() == botan.name() +if CRYPTO_DEP.name() == botan.name() report_conf_data.set('CRYPTO_NAME', 'Botan') result = cpp.run( fs.read('compiler-checks/get-botan-version.cc'), name: 'Get Botan version', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], ) if result.returncode() == 0 report_conf_data.set('CRYPTO_VERSION', result.stdout().strip()) else report_conf_data.set('CRYPTO_VERSION', botan.version()) endif -elif crypto.name() == openssl.name() +elif CRYPTO_DEP.name() == openssl.name() report_conf_data.set('CRYPTO_NAME', 'OpenSSL') result = cpp.run( fs.read('compiler-checks/get-openssl-version.cc'), name: 'Get OpenSSL version', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], ) if result.returncode() == 0 report_conf_data.set('CRYPTO_VERSION', result.stdout().strip()) @@ -672,20 +486,23 @@ elif crypto.name() == openssl.name() endif endif # TODO: remove if-condition when support for Ubuntu 20.04 gets removed. -if log4cplus.type_name() == 'pkgconfig' +if LOG4CPLUS_DEP.type_name() == 'pkgconfig' report_conf_data.set( 'LOG4CPLUS_INCLUDE', - log4cplus.get_variable('includedir', default_value: 'unknown'), + LOG4CPLUS_DEP.get_variable('includedir', default_value: 'unknown'), ) report_conf_data.set( 'LOG4CPLUS_LIBDIR', - log4cplus.get_variable('libdir', default_value: 'unknown'), + LOG4CPLUS_DEP.get_variable('libdir', default_value: 'unknown'), ) +else + report_conf_data.set('LOG4CPLUS_INCLUDE', 'unknown') + report_conf_data.set('LOG4CPLUS_LIBDIR', 'unknown') endif result = cpp.run( fs.read('compiler-checks/get-log4cplus-version.cc'), name: 'Get Log4cplus version', - dependencies: [log4cplus], + dependencies: [LOG4CPLUS_DEP], ) if result.returncode() == 0 report_conf_data.set('LOG4CPLUS_VERSION', result.stdout().strip()) @@ -702,63 +519,55 @@ if BISON.found() else report_conf_data.set('BISON', 'unknown') endif -if mysql.found() - if not mysql_config.found() - report_conf_data.set('MYSQL_VERSION', mysql.version()) - report_conf_data.set( - 'MYSQL_INCLUDE', - mysql.get_variable('includedir', default_value: 'unknown'), - ) - report_conf_data.set( - 'MYSQL_LIBDIR', - mysql.get_variable('libdir', default_value: 'unknown'), - ) - else - report_conf_data.set('MYSQL_VERSION', mysql_version) - report_conf_data.set('MYSQL_INCLUDE', ' '.join(mysql_compile_args)) - report_conf_data.set('MYSQL_LIBDIR', ' '.join(mysql_link_args)) - endif +if MYSQL_DEP.found() + report_conf_data.set('MYSQL_VERSION', MYSQL_DEP.version()) + report_conf_data.set( + 'MYSQL_INCLUDE', + MYSQL_DEP.get_variable('includedir', default_value: 'unknown'), + ) + report_conf_data.set( + 'MYSQL_LIBDIR', + MYSQL_DEP.get_variable('libdir', default_value: 'unknown'), + ) else report_conf_data.set('HAVE_MYSQL', 'no') report_conf_data.set('MYSQL_VERSION', 'unknown') report_conf_data.set('MYSQL_INCLUDE', 'unknown') report_conf_data.set('MYSQL_LIBDIR', 'unknown') endif -if postgresql.found() +if POSTGRESQL_DEP.found() report_conf_data.set('HAVE_PGSQL', 'yes') - if not pg_config.found() - report_conf_data.set('PGSQL_VERSION', postgresql.version()) - report_conf_data.set( - 'PGSQL_INCLUDE', - postgresql.get_variable('includedir', default_value: 'unknown'), - ) - report_conf_data.set( - 'PGSQL_LIBDIR', - postgresql.get_variable('libdir', default_value: 'unknown'), - ) - else - report_conf_data.set('PGSQL_VERSION', pgsql_version) - report_conf_data.set('PGSQL_INCLUDE', ' '.join(pgsql_compile_args)) - report_conf_data.set('PGSQL_LIBDIR', ' '.join(pgsql_link_args)) - endif + report_conf_data.set('PGSQL_VERSION', POSTGRESQL_DEP.version()) + report_conf_data.set( + 'PGSQL_INCLUDE', + POSTGRESQL_DEP.get_variable('includedir', default_value: 'unknown'), + ) + report_conf_data.set( + 'PGSQL_LIBDIR', + POSTGRESQL_DEP.get_variable('libdir', default_value: 'unknown'), + ) else report_conf_data.set('HAVE_PGSQL', 'no') report_conf_data.set('PGSQL_VERSION', 'unknown') report_conf_data.set('PGSQL_INCLUDE', 'unknown') report_conf_data.set('PGSQL_LIBDIR', 'unknown') endif -report_conf_data.set('HAVE_NETCONF', 'no') -if gtest.found() +if NETCONF_DEP.found() + report_conf_data.set('HAVE_NETCONF', 'yes') +else + report_conf_data.set('HAVE_NETCONF', 'no') +endif +if FUZZ_OPT.enabled() or TESTS_OPT.enabled() report_conf_data.set('HAVE_GTEST', 'yes') report_conf_data.set( 'GTEST_INCLUDE', - gtest.get_variable('includedir', default_value: 'unknown'), + GTEST_DEP.get_variable('includedir', default_value: 'unknown'), ) report_conf_data.set( 'GTEST_LIBDIR', - gtest.get_variable('libdir', default_value: 'unknown'), + GTEST_DEP.get_variable('libdir', default_value: 'unknown'), ) - report_conf_data.set('GTEST_VERSION', gtest.version()) + report_conf_data.set('GTEST_VERSION', GTEST_DEP.version()) else report_conf_data.set('HAVE_GTEST', 'no') report_conf_data.set('GTEST_VERSION', 'unknown') @@ -887,7 +696,7 @@ subdir('src') subdir('fuzz') subdir('doc') subdir('premium', if_found: premium) -subdir('contrib', if_found: contrib) +subproject('contrib', required: false) #### More Custom Targets diff --git a/meson.options b/meson.options index 057a3a62c8..a72b100c91 100644 --- a/meson.options +++ b/meson.options @@ -1,28 +1,31 @@ -# all +# Dependency-related options option( - 'all', + 'crypto', + type: 'combo', + choices: ['botan', 'openssl'], + value: 'openssl', + description: 'Backend for cryptographical operations. Mandatory.', +) +option( + 'krb5', type: 'feature', - value: 'disabled', - description: 'Requires that all C++ dependencies be enabled: crypto (either botan or openssl), krb5 with gssapi, mysql, netconf, postgresql. Also enables generation of docs and parser which requires bison, flex, and sphinx. Also enables all parts of code: debug, fuzzing, logger-checks, perfdhcp, shell. Overrides the other options.', + description: 'Support for GSS-TSIG. Requires krb5 with gssapi.', +) +option('mysql', type: 'feature', description: 'Support for MySQL backends.') +option('netconf', type: 'feature', description: 'Support for kea-netconf.') +option( + 'postgresql', + type: 'feature', + description: 'Support for PostgreSQL backends.', ) -# Dependency-related options -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('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('postgresql', type: 'combo', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for PostgreSQL backends.') - -# Used for development. -# option('docs', type: 'feature', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for doc generation.') -# option('parser', type: 'feature', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for parser generation.') - # 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? -# 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('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('fuzz', type: 'feature', description: 'Support for fuzz testing.') +option( + 'logger-checks', + type: 'feature', + value: 'disabled', + description: 'Check logger messages.', +) +option('shell', type: 'feature', description: 'Builds kea-shell.') +option('tests', type: 'feature', description: 'Support for tests.') diff --git a/src/bin/admin/tests/meson.build b/src/bin/admin/tests/meson.build index ed257f97eb..502c0e0964 100644 --- a/src/bin/admin/tests/meson.build +++ b/src/bin/admin/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -35,7 +35,7 @@ mysql_tests = configure_file( output: 'mysql_tests.sh', configuration: kea_admin_tests_conf_data, ) -if mysql.found() +if MYSQL_DEP.found() test( 'kea_admin_mysql_tests.sh', mysql_tests, @@ -49,7 +49,7 @@ pgsql_tests = configure_file( output: 'pgsql_tests.sh', configuration: kea_admin_tests_conf_data, ) -if postgresql.found() +if POSTGRESQL_DEP.found() test( 'kea_admin_pgsql_tests.sh', pgsql_tests, diff --git a/src/bin/agent/meson.build b/src/bin/agent/meson.build index 823fb9e269..fa66ad2b88 100644 --- a/src/bin/agent/meson.build +++ b/src/bin/agent/meson.build @@ -11,13 +11,13 @@ agent_lib = static_library( 'ca_response_creator.cc', 'parser_context.cc', 'simple_parser.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, ) executable( 'kea-ctrl-agent', 'main.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'sbin', diff --git a/src/bin/agent/tests/meson.build b/src/bin/agent/tests/meson.build index bc9af0b942..43b814d413 100644 --- a/src/bin/agent/tests/meson.build +++ b/src/bin/agent/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -77,7 +77,7 @@ kea_agent_tests = executable( f'-DSYNTAX_FILE="@current_source_dir@/../agent_parser.yy"', f'-DTEST_CA_DIR="@TEST_CA_DIR@"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [agent_lib] + kea_agent_tests_libs + LIBS_BUILT_SO_FAR, ) diff --git a/src/bin/d2/meson.build b/src/bin/d2/meson.build index 5f8065f239..dd2467cde9 100644 --- a/src/bin/d2/meson.build +++ b/src/bin/d2/meson.build @@ -15,13 +15,13 @@ d2_lib = static_library( 'simple_add_without_dhcid.cc', 'simple_remove.cc', 'simple_remove_without_dhcid.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, ) executable( 'kea-dhcp-ddns', 'main.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'sbin', diff --git a/src/bin/d2/tests/meson.build b/src/bin/d2/tests/meson.build index f464393ee6..10a806b219 100644 --- a/src/bin/d2/tests/meson.build +++ b/src/bin/d2/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -88,7 +88,7 @@ kea_d2_tests = executable( f'-DSYNTAX_FILE="@current_source_dir@/../d2_parser.yy"', f'-DTEST_CA_DIR="@TEST_CA_DIR@"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [d2_lib] + kea_d2_tests_libs + LIBS_BUILT_SO_FAR, ) diff --git a/src/bin/dhcp4/meson.build b/src/bin/dhcp4/meson.build index 3766f8cd6c..1d4cebb517 100644 --- a/src/bin/dhcp4/meson.build +++ b/src/bin/dhcp4/meson.build @@ -10,13 +10,13 @@ dhcp4_lib = static_library( 'dhcp4_srv.cc', 'json_config_parser.cc', 'parser_context.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, ) kea_dhcp4 = executable( 'kea-dhcp4', 'main.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'sbin', diff --git a/src/bin/dhcp4/tests/meson.build b/src/bin/dhcp4/tests/meson.build index 2102956f88..9ae49c9f7a 100644 --- a/src/bin/dhcp4/tests/meson.build +++ b/src/bin/dhcp4/tests/meson.build @@ -1,10 +1,10 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif current_build_dir = meson.current_build_dir() current_source_dir = meson.current_source_dir() -dhcp4_tests_deps = [crypto, gtest] +dhcp4_tests_deps = [CRYPTO_DEP, GTEST_DEP] dhcp4_tests_libs = [ kea_dhcpsrv_testutils_lib, kea_dhcp_testutils_lib, @@ -13,16 +13,16 @@ dhcp4_tests_libs = [ kea_util_unittests_lib, kea_asiolink_testutils_lib, ] -if mysql.found() - dhcp4_tests_deps += [mysql] +if MYSQL_DEP.found() + dhcp4_tests_deps += [MYSQL_DEP] dhcp4_tests_libs += [ dhcp_mysql_archive, kea_mysql_testutils_lib, kea_mysql_lib, ] endif -if postgresql.found() - dhcp4_tests_deps += [postgresql] +if POSTGRESQL_DEP.found() + dhcp4_tests_deps += [POSTGRESQL_DEP] dhcp4_tests_libs += [ dhcp_pgsql_archive, kea_pgsql_testutils_lib, diff --git a/src/bin/dhcp6/meson.build b/src/bin/dhcp6/meson.build index a6f2738d82..359a77559b 100644 --- a/src/bin/dhcp6/meson.build +++ b/src/bin/dhcp6/meson.build @@ -11,13 +11,13 @@ dhcp6_lib = static_library( 'json_config_parser.cc', 'main.cc', 'parser_context.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, ) kea_dhcp6 = executable( 'kea-dhcp6', 'main.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'sbin', diff --git a/src/bin/dhcp6/tests/meson.build b/src/bin/dhcp6/tests/meson.build index 1b4e47b808..a7f6cccea4 100644 --- a/src/bin/dhcp6/tests/meson.build +++ b/src/bin/dhcp6/tests/meson.build @@ -1,10 +1,10 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif current_build_dir = meson.current_build_dir() current_source_dir = meson.current_source_dir() -dhcp6_tests_deps = [crypto, gtest] +dhcp6_tests_deps = [CRYPTO_DEP, GTEST_DEP] dhcp6_tests_libs = [ kea_dhcpsrv_testutils_lib, kea_dhcp_testutils_lib, @@ -13,16 +13,16 @@ dhcp6_tests_libs = [ kea_util_unittests_lib, kea_asiolink_testutils_lib, ] -if mysql.found() - dhcp6_tests_deps += [mysql] +if MYSQL_DEP.found() + dhcp6_tests_deps += [MYSQL_DEP] dhcp6_tests_libs += [ dhcp_mysql_archive, kea_mysql_testutils_lib, kea_mysql_lib, ] endif -if postgresql.found() - dhcp6_tests_deps += [postgresql] +if POSTGRESQL_DEP.found() + dhcp6_tests_deps += [POSTGRESQL_DEP] dhcp6_tests_libs += [ dhcp_pgsql_archive, kea_pgsql_testutils_lib, diff --git a/src/bin/keactrl/meson.build b/src/bin/keactrl/meson.build index 85103c1b4d..53d04d33f6 100644 --- a/src/bin/keactrl/meson.build +++ b/src/bin/keactrl/meson.build @@ -4,7 +4,7 @@ keactrl_conf_data.set('sysconfdir', '${prefix}/' + SYSCONFDIR) keactrl_conf_data.set('PACKAGE', 'kea') keactrl_conf_data.set('exec_prefix', '${prefix}') keactrl_conf_data.set('sbindir', '${prefix}/' + get_option('sbindir')) -if NETCONF_DEPS_FOUND +if NETCONF_DEP.found() keactrl_conf_data.set('HAVE_NETCONF', 'yes') else keactrl_conf_data.set('HAVE_NETCONF', 'no') @@ -59,7 +59,7 @@ configure_file( input: 'kea-netconf.conf.pre', output: 'kea-netconf.conf', command: [path_replacer, '@INPUT@', '@OUTPUT@'], - install: NETCONF_DEPS_FOUND, + install: NETCONF_DEP.found(), install_dir: kea_configfiles_destdir, ) subdir('tests') diff --git a/src/bin/keactrl/tests/meson.build b/src/bin/keactrl/tests/meson.build index 8fb0cb6718..b307313d84 100644 --- a/src/bin/keactrl/tests/meson.build +++ b/src/bin/keactrl/tests/meson.build @@ -1,10 +1,10 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif keactrl_tests_conf_data = configuration_data() keactrl_tests_conf_data.set('abs_top_builddir', TOP_BUILD_DIR) -if NETCONF_DEPS_FOUND +if NETCONF_DEP.found() keactrl_tests_conf_data.set('HAVE_NETCONF', 'yes') else keactrl_tests_conf_data.set('HAVE_NETCONF', 'no') diff --git a/src/bin/lfc/tests/meson.build b/src/bin/lfc/tests/meson.build index 2b5fa6255f..59692ce1a4 100644 --- a/src/bin/lfc/tests/meson.build +++ b/src/bin/lfc/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -8,7 +8,7 @@ kea_lfc_tests = executable( 'lfc_controller_unittests.cc', 'lfc_unittests.cc', cpp_args: [f'-DTEST_DATA_BUILDDIR="@current_build_dir@"'], - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [lfc_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/bin/netconf/meson.build b/src/bin/netconf/meson.build index a9b4a2b654..291eee3e3c 100644 --- a/src/bin/netconf/meson.build +++ b/src/bin/netconf/meson.build @@ -1,4 +1,4 @@ -if not NETCONF_DEPS_FOUND +if not NETCONF_DEP.found() subdir_done() endif @@ -19,16 +19,16 @@ netconf_lib = static_library( 'simple_parser.cc', 'stdout_control_socket.cc', 'unix_control_socket.cc', - dependencies: NETCONF_DEPS_ARRAY + [crypto], + dependencies: [NETCONF_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, - link_with: [kea_yang_testutils_lib, kea_process_testutils_lib] + LIBS_BUILT_SO_FAR, + link_with: LIBS_BUILT_SO_FAR, override_options: ['cpp_std=c++20'], ) executable( 'kea-netconf', 'main.cc', - dependencies: NETCONF_DEPS_ARRAY + [crypto], + dependencies: [NETCONF_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'sbin', diff --git a/src/bin/netconf/tests/meson.build b/src/bin/netconf/tests/meson.build index e6d5f3930c..92a36e7c5d 100644 --- a/src/bin/netconf/tests/meson.build +++ b/src/bin/netconf/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() or not NETCONF_DEPS_FOUND +if not TESTS_OPT.enabled() or not NETCONF_DEP.found() subdir_done() endif @@ -33,7 +33,7 @@ kea_netconf_tests = executable( f'-DTEST_DATA_SOURCEDIR="@current_source_dir@"', f'-DTEST_DATA_BUILDDIR="@current_build_dir@"', ], - dependencies: NETCONF_DEPS_ARRAY + [gtest, crypto], + dependencies: [NETCONF_DEP, GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [ netconf_lib, diff --git a/src/bin/netconf/tests/shtests/meson.build b/src/bin/netconf/tests/shtests/meson.build index f969fa028e..257c366269 100644 --- a/src/bin/netconf/tests/shtests/meson.build +++ b/src/bin/netconf/tests/shtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif diff --git a/src/bin/perfdhcp/meson.build b/src/bin/perfdhcp/meson.build index 0df78a5901..36c8353d9e 100644 --- a/src/bin/perfdhcp/meson.build +++ b/src/bin/perfdhcp/meson.build @@ -1,7 +1,3 @@ -if PERFDHCP_OPT != 'enabled' - subdir_done() -endif - perfdhcp_lib = static_library( 'perfdhcp', 'avalanche_scen.cc', diff --git a/src/bin/perfdhcp/tests/meson.build b/src/bin/perfdhcp/tests/meson.build index 96bd4b9a01..b5727d69e6 100644 --- a/src/bin/perfdhcp/tests/meson.build +++ b/src/bin/perfdhcp/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -19,7 +19,7 @@ perfdhcp_tests = executable( 'stats_mgr_unittest.cc', 'test_control_unittest.cc', cpp_args: [f'-DTEST_DATA_DIR="@current_source_dir@/testdata"'], - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [perfdhcp_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/bin/shell/meson.build b/src/bin/shell/meson.build index 294819cbd1..10cc7b4231 100644 --- a/src/bin/shell/meson.build +++ b/src/bin/shell/meson.build @@ -1,4 +1,4 @@ -if SHELL_OPT != 'enabled' +if not SHELL_OPT.enabled() subdir_done() endif diff --git a/src/bin/shell/tests/meson.build b/src/bin/shell/tests/meson.build index 393c99946c..9df914e2ef 100644 --- a/src/bin/shell/tests/meson.build +++ b/src/bin/shell/tests/meson.build @@ -1,8 +1,7 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif - shell_tests_conf_data = configuration_data() shell_tests_conf_data.set('PYTHON', PYTHON.full_path()) shell_tests_conf_data.set('abs_top_builddir', TOP_BUILD_DIR) diff --git a/src/hooks/d2/gss_tsig/libloadtests/meson.build b/src/hooks/d2/gss_tsig/libloadtests/meson.build index c0e2edc821..d570cb80b4 100644 --- a/src/hooks/d2/gss_tsig/libloadtests/meson.build +++ b/src/hooks/d2/gss_tsig/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -11,7 +11,7 @@ ddns_gss_tsig_libloadtests = executable( f'-DTEST_DATA_BUILDDIR="@current_source_dir@"', f'-DLIBDHCP_GSS_TSIG_SO="@TOP_BUILD_DIR@/src/hooks/d2/gss_tsig/libddns_gss_tsig.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/d2/gss_tsig/meson.build b/src/hooks/d2/gss_tsig/meson.build index d8a90d53fd..6a1932bb74 100644 --- a/src/hooks/d2/gss_tsig/meson.build +++ b/src/hooks/d2/gss_tsig/meson.build @@ -1,4 +1,4 @@ -if not krb5.found() +if not KRB5_DEP.found() subdir_done() endif @@ -15,7 +15,7 @@ ddns_gss_tsig_lib = shared_library( 'managed_key.cc', 'tkey_exchange.cc', 'version.cc', - dependencies: [krb5, crypto], + dependencies: [KRB5_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/d2/gss_tsig/tests/meson.build b/src/hooks/d2/gss_tsig/tests/meson.build index 76e5beebc7..d75579e4db 100644 --- a/src/hooks/d2/gss_tsig/tests/meson.build +++ b/src/hooks/d2/gss_tsig/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() or not krb5.found() +if not TESTS_OPT.enabled() or not KRB5_DEP.found() subdir_done() endif @@ -23,7 +23,7 @@ ddns_gss_tsig_tests = executable( 'tkey_exchange_unittests.cc', 'tkey_unittests.cc', cpp_args: [f'-DTEST_DATA_DIR="@current_source_dir@"'], - dependencies: [krb5, gtest, crypto], + dependencies: [KRB5_DEP, GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [ddns_gss_tsig_tests_libs] + LIBS_BUILT_SO_FAR, ) @@ -33,7 +33,7 @@ executable( 'nsupdate', 'nsupdate.cc', cpp_args: [f'-DTEST_DATA_DIR="@current_source_dir@"'], - dependencies: [krb5], + dependencies: [KRB5_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [ddns_gss_tsig_archive] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/d2/gss_tsig/testutils/meson.build b/src/hooks/d2/gss_tsig/testutils/meson.build index ab9ab20ca7..d91e8231a6 100644 --- a/src/hooks/d2/gss_tsig/testutils/meson.build +++ b/src/hooks/d2/gss_tsig/testutils/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -7,6 +7,6 @@ ddns_gss_tsig_testutils_lib = static_library( 'ddns-gss-tsig-testutils', 'gss_tsig_dns_server.cc', cpp_args: [f'-DTEST_DATA_DIR="@current_source_dir@"'], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, ) diff --git a/src/hooks/dhcp/bootp/libloadtests/meson.build b/src/hooks/dhcp/bootp/libloadtests/meson.build index 49b7b228d8..9f92bcb962 100644 --- a/src/hooks/dhcp/bootp/libloadtests/meson.build +++ b/src/hooks/dhcp/bootp/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -9,7 +9,7 @@ dhcp_bootp_libload_tests = executable( cpp_args: [ f'-DLIBDHCP_BOOTP_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/bootp/libdhcp_bootp.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/bootp/tests/meson.build b/src/hooks/dhcp/bootp/tests/meson.build index efa912066e..bd42fdd3be 100644 --- a/src/hooks/dhcp/bootp/tests/meson.build +++ b/src/hooks/dhcp/bootp/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -9,7 +9,7 @@ dhcp_bootp_lib_tests = executable( cpp_args: [ f'-DBOOTP_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/bootp/libdhcp_bootp.so"', ], - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_bootp_archive] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/class_cmds/libloadtests/meson.build b/src/hooks/dhcp/class_cmds/libloadtests/meson.build index 25c2d60960..17b95eb480 100644 --- a/src/hooks/dhcp/class_cmds/libloadtests/meson.build +++ b/src/hooks/dhcp/class_cmds/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -9,7 +9,7 @@ dhcp_class_cmds_libloadtests = executable( cpp_args: [ f'-DLIBDHCP_CLASS_CMDS_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/class_cmds/libdhcp_class_cmds.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/class_cmds/meson.build b/src/hooks/dhcp/class_cmds/meson.build index 4c3d82c7a3..4a569934e1 100644 --- a/src/hooks/dhcp/class_cmds/meson.build +++ b/src/hooks/dhcp/class_cmds/meson.build @@ -5,7 +5,7 @@ dhcp_class_cmds_lib = shared_library( 'class_cmds_log.cc', 'class_cmds_messages.cc', 'version.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/class_cmds/tests/meson.build b/src/hooks/dhcp/class_cmds/tests/meson.build index 4869c0a4e0..c7c026c013 100644 --- a/src/hooks/dhcp/class_cmds/tests/meson.build +++ b/src/hooks/dhcp/class_cmds/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -6,7 +6,7 @@ dhcp_class_cmds_tests = executable( 'dhcp-class-cmds-tests', 'class_cmds_unittest.cc', 'run_unittests.cc', - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_class_cmds_archive] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/ddns_tuning/libloadtests/meson.build b/src/hooks/dhcp/ddns_tuning/libloadtests/meson.build index e83b1591c0..b0b6a2cf18 100644 --- a/src/hooks/dhcp/ddns_tuning/libloadtests/meson.build +++ b/src/hooks/dhcp/ddns_tuning/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -12,7 +12,7 @@ dhcp_ddns_tuning_libloadtests = executable( cpp_args: [ f'-DDDNS_TUNING_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/ddns_tuning/libdhcp_ddns_tuning.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/ddns_tuning/meson.build b/src/hooks/dhcp/ddns_tuning/meson.build index c25010c94f..e8e2a3f5a0 100644 --- a/src/hooks/dhcp/ddns_tuning/meson.build +++ b/src/hooks/dhcp/ddns_tuning/meson.build @@ -6,7 +6,7 @@ dhcp_ddns_tuning_lib = shared_library( 'ddns_tuning_messages.cc', 'expression_cache.cc', 'version.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/ddns_tuning/tests/meson.build b/src/hooks/dhcp/ddns_tuning/tests/meson.build index 45fc91e902..9e4e700e42 100644 --- a/src/hooks/dhcp/ddns_tuning/tests/meson.build +++ b/src/hooks/dhcp/ddns_tuning/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -7,7 +7,7 @@ dhcp_ddns_tuning_tests = executable( 'ddns_tuning_unittests.cc', 'expression_cache_unittests.cc', 'run_unittests.cc', - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_ddns_tuning_archive] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/flex_id/libloadtests/meson.build b/src/hooks/dhcp/flex_id/libloadtests/meson.build index 8e5a737610..997c9fad1f 100644 --- a/src/hooks/dhcp/flex_id/libloadtests/meson.build +++ b/src/hooks/dhcp/flex_id/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -11,7 +11,7 @@ dhcp_flex_id_libloadtests = executable( f'-DTEST_DATA_BUILDDIR="@current_build_dir@"', f'-DLIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/flex_id/libdhcp_flex_id.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/flex_id/meson.build b/src/hooks/dhcp/flex_id/meson.build index b8fb90bf1e..95d38a8fe1 100644 --- a/src/hooks/dhcp/flex_id/meson.build +++ b/src/hooks/dhcp/flex_id/meson.build @@ -5,7 +5,7 @@ dhcp_flex_id_lib = shared_library( 'flex_id_messages.cc', 'load_unload.cc', 'version.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/flex_id/tests/meson.build b/src/hooks/dhcp/flex_id/tests/meson.build index f696468f22..03f88446db 100644 --- a/src/hooks/dhcp/flex_id/tests/meson.build +++ b/src/hooks/dhcp/flex_id/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -8,7 +8,7 @@ dhcp_flex_id_tests = executable( 'callout_unittests.cc', 'run_unittests.cc', cpp_args: [f'-DTEST_DATA_BUILDDIR="@current_build_dir@"'], - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_flex_id_archive] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/flex_option/libloadtests/meson.build b/src/hooks/dhcp/flex_option/libloadtests/meson.build index 8c36cc2ab2..c2c69cdf44 100644 --- a/src/hooks/dhcp/flex_option/libloadtests/meson.build +++ b/src/hooks/dhcp/flex_option/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -10,7 +10,7 @@ dhcp_flex_option_libload_tests = executable( cpp_args: [ f'-DFLEX_OPTION_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/flex_option/libdhcp_flex_option.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/flex_option/meson.build b/src/hooks/dhcp/flex_option/meson.build index d0a34b1958..dc8c0d2665 100644 --- a/src/hooks/dhcp/flex_option/meson.build +++ b/src/hooks/dhcp/flex_option/meson.build @@ -5,7 +5,7 @@ dhcp_flex_option_lib = shared_library( 'flex_option_log.cc', 'flex_option_messages.cc', 'version.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/flex_option/tests/meson.build b/src/hooks/dhcp/flex_option/tests/meson.build index 8d67b45a85..da0c58c43e 100644 --- a/src/hooks/dhcp/flex_option/tests/meson.build +++ b/src/hooks/dhcp/flex_option/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -10,7 +10,7 @@ dhcp_flex_option_lib_tests = executable( cpp_args: [ f'-DFLEX_OPTION_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/flex_option/libdhcp_flex_option.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_flex_option_archive] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/forensic_log/libloadtests/meson.build b/src/hooks/dhcp/forensic_log/libloadtests/meson.build index 6b454e699a..ee1c7b8d16 100644 --- a/src/hooks/dhcp/forensic_log/libloadtests/meson.build +++ b/src/hooks/dhcp/forensic_log/libloadtests/meson.build @@ -1,19 +1,19 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif current_build_dir = meson.current_build_dir() link_with = [kea_database_testutils_lib] -dependencies = [gtest, crypto] +dependencies = [GTEST_DEP, CRYPTO_DEP] -if mysql.found() - dependencies += [mysql] +if MYSQL_DEP.found() + dependencies += [MYSQL_DEP] link_with += [dhcp_mysql_lib, kea_mysql_testutils_lib] endif -if postgresql.found() - dependencies += [postgresql] +if POSTGRESQL_DEP.found() + dependencies += [POSTGRESQL_DEP] link_with += [dhcp_pgsql_lib, kea_pgsql_testutils_lib] endif @@ -26,7 +26,11 @@ dhcp_forensic_log_libloadtests = executable( f'-DLEGAL_LOG_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/forensic_log/libdhcp_legal_log.so"', ], dependencies: dependencies, - include_directories: [include_directories('.'), include_directories('..'), include_directories('../..')] + INCLUDES, + include_directories: [ + include_directories('.'), + include_directories('..'), + include_directories('../..'), + ] + INCLUDES, link_with: [link_with] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/forensic_log/meson.build b/src/hooks/dhcp/forensic_log/meson.build index 3bccdd8e40..0f2693fa68 100644 --- a/src/hooks/dhcp/forensic_log/meson.build +++ b/src/hooks/dhcp/forensic_log/meson.build @@ -9,7 +9,7 @@ dhcp_forensic_log_lib = shared_library( 'rotating_file.cc', 'version.cc', cpp_args: [f'-DLEGAL_LOG_DIR="@LEGAL_LOG_DIR@"'], - dependencies: [crypto, mysql, postgresql], + dependencies: [CRYPTO_DEP, MYSQL_DEP, POSTGRESQL_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/forensic_log/tests/meson.build b/src/hooks/dhcp/forensic_log/tests/meson.build index e82810f168..0964e21eda 100644 --- a/src/hooks/dhcp/forensic_log/tests/meson.build +++ b/src/hooks/dhcp/forensic_log/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -15,7 +15,7 @@ configure_file( current_build_dir = meson.current_build_dir() -dependencies = [gtest, crypto] +dependencies = [GTEST_DEP, CRYPTO_DEP] dhcp_forensic_log_tests_libs = [ dhcp_forensic_log_archive, diff --git a/src/hooks/dhcp/high_availability/libloadtests/meson.build b/src/hooks/dhcp/high_availability/libloadtests/meson.build index 5ed9dc885d..57114f687b 100644 --- a/src/hooks/dhcp/high_availability/libloadtests/meson.build +++ b/src/hooks/dhcp/high_availability/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -10,7 +10,7 @@ dhcp_ha_libload_tests = executable( cpp_args: [ f'-DLIBDHCP_HA_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/high_availability/libdhcp_ha.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/high_availability/meson.build b/src/hooks/dhcp/high_availability/meson.build index 93eb4d831b..df0d5edd37 100644 --- a/src/hooks/dhcp/high_availability/meson.build +++ b/src/hooks/dhcp/high_availability/meson.build @@ -14,7 +14,7 @@ dhcp_ha_lib = shared_library( 'lease_update_backlog.cc', 'query_filter.cc', 'version.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/high_availability/tests/meson.build b/src/hooks/dhcp/high_availability/tests/meson.build index 70e38f7505..5665dff4a4 100644 --- a/src/hooks/dhcp/high_availability/tests/meson.build +++ b/src/hooks/dhcp/high_availability/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -21,7 +21,7 @@ dhcp_ha_lib_tests = executable( f'-DTEST_CA_DIR="@TEST_CA_DIR@"', f'-DTEST_HTTP_DIR="@TOP_SOURCE_DIR@/src/lib/http/tests/testdata"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_ha_archive, [kea_testutils_lib]] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/host_cache/libloadtests/meson.build b/src/hooks/dhcp/host_cache/libloadtests/meson.build index 7574a58fce..a495112483 100644 --- a/src/hooks/dhcp/host_cache/libloadtests/meson.build +++ b/src/hooks/dhcp/host_cache/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -11,7 +11,7 @@ dhcp_host_cache_libloadtests = executable( f'-DTEST_DATA_BUILDDIR="@current_build_dir@"', f'-DLIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/host_cache/libdhcp_host_cache.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/host_cache/meson.build b/src/hooks/dhcp/host_cache/meson.build index 9584c29fa8..b8e520176b 100644 --- a/src/hooks/dhcp/host_cache/meson.build +++ b/src/hooks/dhcp/host_cache/meson.build @@ -8,7 +8,7 @@ dhcp_host_cache_lib = shared_library( 'host_cache_messages.cc', 'host_cache_parsers.cc', 'version.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/host_cache/tests/meson.build b/src/hooks/dhcp/host_cache/tests/meson.build index ea3b9a6754..9a2ab56e38 100644 --- a/src/hooks/dhcp/host_cache/tests/meson.build +++ b/src/hooks/dhcp/host_cache/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -15,7 +15,7 @@ dhcp_host_cache_tests = executable( 'host_data_source_unittests.cc', 'run_unittests.cc', cpp_args: [f'-DTEST_DATA_BUILDDIR="@current_build_dir@"'], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_host_cache_tests_libs] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/host_cmds/libloadtests/meson.build b/src/hooks/dhcp/host_cmds/libloadtests/meson.build index 07db8cc0f7..0ac1716841 100644 --- a/src/hooks/dhcp/host_cmds/libloadtests/meson.build +++ b/src/hooks/dhcp/host_cmds/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -9,7 +9,7 @@ dhcp_host_cmds_libloadtests = executable( cpp_args: [ f'-DLIBDHCP_HOST_CMDS_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/host_cmds/libdhcp_host_cmds.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/host_cmds/meson.build b/src/hooks/dhcp/host_cmds/meson.build index d14900e37d..b140407f35 100644 --- a/src/hooks/dhcp/host_cmds/meson.build +++ b/src/hooks/dhcp/host_cmds/meson.build @@ -5,7 +5,7 @@ dhcp_host_cmds_lib = shared_library( 'host_cmds_log.cc', 'host_cmds_messages.cc', 'version.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/host_cmds/tests/meson.build b/src/hooks/dhcp/host_cmds/tests/meson.build index de1f50b95e..ec4db6e405 100644 --- a/src/hooks/dhcp/host_cmds/tests/meson.build +++ b/src/hooks/dhcp/host_cmds/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -8,7 +8,7 @@ dhcp_host_cmds_tests = executable( 'host_cmds_unittest.cc', 'host_data_parser_unittest.cc', 'run_unittests.cc', - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_host_cmds_tests_libs] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/lease_cmds/libloadtests/meson.build b/src/hooks/dhcp/lease_cmds/libloadtests/meson.build index 703e0d0bdb..6cb9cf966a 100644 --- a/src/hooks/dhcp/lease_cmds/libloadtests/meson.build +++ b/src/hooks/dhcp/lease_cmds/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -12,7 +12,7 @@ dhcp_lease_cmds_libload_tests = executable( cpp_args: [ f'-DLIBDHCP_LEASE_CMDS_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/lease_cmds/libdhcp_lease_cmds.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/lease_cmds/meson.build b/src/hooks/dhcp/lease_cmds/meson.build index 6fa6fbd7b0..d2701aa8e9 100644 --- a/src/hooks/dhcp/lease_cmds/meson.build +++ b/src/hooks/dhcp/lease_cmds/meson.build @@ -7,7 +7,7 @@ dhcp_lease_cmds_lib = shared_library( 'lease_cmds_messages.cc', 'lease_parser.cc', 'version.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/lease_cmds/tests/meson.build b/src/hooks/dhcp/lease_cmds/tests/meson.build index f36103388c..a104572e67 100644 --- a/src/hooks/dhcp/lease_cmds/tests/meson.build +++ b/src/hooks/dhcp/lease_cmds/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -8,7 +8,7 @@ dhcp_lease_cmds_lib_tests = executable( 'lease_cmds_func4_unittest.cc', 'lease_cmds_func6_unittest.cc', 'run_unittests.cc', - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_lease_cmds_archive] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/lease_query/libloadtests/meson.build b/src/hooks/dhcp/lease_query/libloadtests/meson.build index e50400a029..c27818439b 100644 --- a/src/hooks/dhcp/lease_query/libloadtests/meson.build +++ b/src/hooks/dhcp/lease_query/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -11,7 +11,7 @@ dhcp_lease_query_libloadtests = executable( f'-DTEST_DATA_BUILDDIR="@current_build_dir@"', f'-DLIBDHCP_LEASE_QUERY_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/lease_query/libdhcp_lease_query.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/lease_query/meson.build b/src/hooks/dhcp/lease_query/meson.build index 485d23eb4a..95c7f18848 100644 --- a/src/hooks/dhcp/lease_query/meson.build +++ b/src/hooks/dhcp/lease_query/meson.build @@ -13,7 +13,7 @@ dhcp_lease_query_lib = shared_library( 'lease_query_messages.cc', 'mt_lease_query_mgr.cc', 'version.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/lease_query/tests/meson.build b/src/hooks/dhcp/lease_query/tests/meson.build index 38833f35bf..48b6a8718a 100644 --- a/src/hooks/dhcp/lease_query/tests/meson.build +++ b/src/hooks/dhcp/lease_query/tests/meson.build @@ -1,17 +1,17 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif current_build_dir = meson.current_build_dir() -dhcp_lease_query_tests_dependencies = [gtest, crypto] +dhcp_lease_query_tests_dependencies = [GTEST_DEP, CRYPTO_DEP] dhcp_lease_query_tests_libs = [dhcp_lease_query_archive] -if mysql.found() +if MYSQL_DEP.found() dhcp_lease_query_tests_libs += [dhcp_mysql_archive, kea_mysql_testutils_lib] - dhcp_lease_query_tests_dependencies += [mysql] + dhcp_lease_query_tests_dependencies += [MYSQL_DEP] endif -if postgresql.found() +if POSTGRESQL_DEP.found() dhcp_lease_query_tests_libs += [dhcp_pgsql_archive, kea_pgsql_testutils_lib] - dhcp_lease_query_tests_dependencies += [postgresql] + dhcp_lease_query_tests_dependencies += [POSTGRESQL_DEP] endif dhcp_lease_query_tests_libs += [ kea_dhcp_testutils_lib, diff --git a/src/hooks/dhcp/limits/libloadtests/meson.build b/src/hooks/dhcp/limits/libloadtests/meson.build index 079af19fa0..e1458420b2 100644 --- a/src/hooks/dhcp/limits/libloadtests/meson.build +++ b/src/hooks/dhcp/limits/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -9,7 +9,7 @@ dhcp_limits_libloadtests = executable( cpp_args: [ f'-DLIBDHCP_LIMITS_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/limits/libdhcp_limits.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/limits/meson.build b/src/hooks/dhcp/limits/meson.build index 935502bfc7..d008af33ad 100644 --- a/src/hooks/dhcp/limits/meson.build +++ b/src/hooks/dhcp/limits/meson.build @@ -8,7 +8,7 @@ dhcp_limits_lib = shared_library( 'limit_manager.cc', 'load_unload.cc', 'version.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/limits/tests/meson.build b/src/hooks/dhcp/limits/tests/meson.build index 7783f0f085..ec6d2eed79 100644 --- a/src/hooks/dhcp/limits/tests/meson.build +++ b/src/hooks/dhcp/limits/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -8,7 +8,7 @@ dhcp_limits_tests = executable( 'limits_unit_tests_limit_manager.cc', 'limits_unit_tests_main.cc', 'limits_unit_tests_rate_limiting.cc', - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_limits_archive, kea_testutils_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/mysql/libloadtests/meson.build b/src/hooks/dhcp/mysql/libloadtests/meson.build index 83b70a2b82..83fdf085a8 100644 --- a/src/hooks/dhcp/mysql/libloadtests/meson.build +++ b/src/hooks/dhcp/mysql/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -9,7 +9,7 @@ dhcp_mysql_libload_tests = executable( cpp_args: [ f'-DLIBDHCP_MYSQL_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/mysql/libdhcp_mysql.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/mysql/meson.build b/src/hooks/dhcp/mysql/meson.build index b9c90295c6..e1f041555f 100644 --- a/src/hooks/dhcp/mysql/meson.build +++ b/src/hooks/dhcp/mysql/meson.build @@ -1,4 +1,4 @@ -if not mysql.found() +if not MYSQL_DEP.found() subdir_done() endif @@ -20,7 +20,7 @@ dhcp_mysql_lib = shared_library( 'mysql_lease_mgr.cc', 'mysql_legal_log.cc', 'version.cc', - dependencies: [crypto, mysql], + dependencies: [CRYPTO_DEP, MYSQL_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/mysql/tests/meson.build b/src/hooks/dhcp/mysql/tests/meson.build index 3495f6a846..816778168e 100644 --- a/src/hooks/dhcp/mysql/tests/meson.build +++ b/src/hooks/dhcp/mysql/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() or not mysql.found() +if not TESTS_OPT.enabled() or not MYSQL_DEP.found() subdir_done() endif @@ -20,10 +20,8 @@ dhcp_mysql_lib_tests = executable( 'mysql_lease_extended_info_unittest.cc', 'mysql_lease_mgr_unittest.cc', 'run_unittests.cc', - cpp_args: [ - f'-DTEST_CA_DIR="@TEST_CA_DIR@"', - ], - dependencies: [gtest, crypto, mysql], + cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'], + dependencies: [GTEST_DEP, CRYPTO_DEP, MYSQL_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_mysql_archive, libs_testutils, kea_testutils_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/perfmon/libloadtests/meson.build b/src/hooks/dhcp/perfmon/libloadtests/meson.build index 44bd8efcd8..b451d31b5b 100644 --- a/src/hooks/dhcp/perfmon/libloadtests/meson.build +++ b/src/hooks/dhcp/perfmon/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -9,7 +9,7 @@ dhcp_perfmon_libload_tests = executable( cpp_args: [ f'-DLIBDHCP_PERFMON_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/perfmon/libdhcp_perfmon.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/perfmon/meson.build b/src/hooks/dhcp/perfmon/meson.build index 4d8a60db92..5a55675d2d 100644 --- a/src/hooks/dhcp/perfmon/meson.build +++ b/src/hooks/dhcp/perfmon/meson.build @@ -10,7 +10,7 @@ dhcp_perfmon_lib = shared_library( 'perfmon_messages.cc', 'perfmon_mgr.cc', 'version.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/perfmon/tests/meson.build b/src/hooks/dhcp/perfmon/tests/meson.build index b575405e35..fab0e5a5b8 100644 --- a/src/hooks/dhcp/perfmon/tests/meson.build +++ b/src/hooks/dhcp/perfmon/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -15,7 +15,7 @@ dhcp_perfmon_lib_tests = executable( cpp_args: [ f'-DPERFMON_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/perfmon/libdhcp_perfmon.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_perfmon_archive, [kea_testutils_lib]] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/pgsql/libloadtests/meson.build b/src/hooks/dhcp/pgsql/libloadtests/meson.build index bbeb49b1f2..840680b4ec 100644 --- a/src/hooks/dhcp/pgsql/libloadtests/meson.build +++ b/src/hooks/dhcp/pgsql/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -9,7 +9,7 @@ dhcp_pgsql_libload_tests = executable( cpp_args: [ f'-DLIBDHCP_PGSQL_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/pgsql/libdhcp_pgsql.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/pgsql/meson.build b/src/hooks/dhcp/pgsql/meson.build index ec3611d384..c38e103eea 100644 --- a/src/hooks/dhcp/pgsql/meson.build +++ b/src/hooks/dhcp/pgsql/meson.build @@ -1,4 +1,4 @@ -if not postgresql.found() +if not POSTGRESQL_DEP.found() subdir_done() endif @@ -20,7 +20,7 @@ dhcp_pgsql_lib = shared_library( 'pgsql_lease_mgr.cc', 'pgsql_legal_log.cc', 'version.cc', - dependencies: [crypto, postgresql], + dependencies: [CRYPTO_DEP, POSTGRESQL_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/pgsql/tests/meson.build b/src/hooks/dhcp/pgsql/tests/meson.build index 775e43c4b1..36716c6210 100644 --- a/src/hooks/dhcp/pgsql/tests/meson.build +++ b/src/hooks/dhcp/pgsql/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() or not postgresql.found() +if not TESTS_OPT.enabled() or not POSTGRESQL_DEP.found() subdir_done() endif @@ -20,7 +20,7 @@ dhcp_pgsql_lib_tests = executable( 'pgsql_lease_extended_info_unittest.cc', 'pgsql_lease_mgr_unittest.cc', 'run_unittests.cc', - dependencies: [gtest, crypto, postgresql], + dependencies: [GTEST_DEP, CRYPTO_DEP, POSTGRESQL_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_pgsql_archive, libs_testutils, kea_testutils_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/ping_check/libloadtests/meson.build b/src/hooks/dhcp/ping_check/libloadtests/meson.build index a5c607eae9..da8bf439c0 100644 --- a/src/hooks/dhcp/ping_check/libloadtests/meson.build +++ b/src/hooks/dhcp/ping_check/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -9,7 +9,7 @@ dhcp_ping_check_libloadtests = executable( cpp_args: [ f'-DPING_CHECK_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/ping_check/libdhcp_ping_check.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/ping_check/meson.build b/src/hooks/dhcp/ping_check/meson.build index 5245d9de17..320d6be7e1 100644 --- a/src/hooks/dhcp/ping_check/meson.build +++ b/src/hooks/dhcp/ping_check/meson.build @@ -11,7 +11,7 @@ dhcp_ping_check_lib = shared_library( 'ping_context.cc', 'ping_context_store.cc', 'version.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/ping_check/tests/meson.build b/src/hooks/dhcp/ping_check/tests/meson.build index 1075a960ef..8beca7813e 100644 --- a/src/hooks/dhcp/ping_check/tests/meson.build +++ b/src/hooks/dhcp/ping_check/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -14,7 +14,7 @@ dhcp_ping_check_tests = executable( 'ping_context_store_unittests.cc', 'ping_context_unittests.cc', 'run_unittests.cc', - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_ping_check_archive] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/radius/libloadtests/meson.build b/src/hooks/dhcp/radius/libloadtests/meson.build index 5627f61836..9514cea7e9 100644 --- a/src/hooks/dhcp/radius/libloadtests/meson.build +++ b/src/hooks/dhcp/radius/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -11,7 +11,7 @@ dhcp_radius_libloadtests = executable( f'-DLIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/radius/libdhcp_radius.so"', f'-DTEST_DICTIONARY="@TOP_SOURCE_DIR@/src/hooks/dhcp/radius/data/dictionary"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/radius/meson.build b/src/hooks/dhcp/radius/meson.build index c0dd0e01ff..30b1b124fd 100644 --- a/src/hooks/dhcp/radius/meson.build +++ b/src/hooks/dhcp/radius/meson.build @@ -26,7 +26,7 @@ dhcp_radius_lib = shared_library( 'radius_utils.cc', 'version.cc', cpp_args: [f'-DDICTIONARY="@PREFIX@/@SYSCONFDIR@/kea/radius/dictionary"'], - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/radius/tests/meson.build b/src/hooks/dhcp/radius/tests/meson.build index 9d0d9805c8..3a20e763ae 100644 --- a/src/hooks/dhcp/radius/tests/meson.build +++ b/src/hooks/dhcp/radius/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -30,7 +30,7 @@ dhcp_radius_tests = executable( f'-DDICTIONARY="@PREFIX@/@SYSCONFDIR@/kea/radius/dictionary"', f'-DTEST_DICTIONARY="@TOP_SOURCE_DIR@/src/hooks/dhcp/radius/data/dictionary"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_radius_tests_libs] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/run_script/libloadtests/meson.build b/src/hooks/dhcp/run_script/libloadtests/meson.build index 368b76aa2b..59b53c350c 100644 --- a/src/hooks/dhcp/run_script/libloadtests/meson.build +++ b/src/hooks/dhcp/run_script/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif hook_includes = [include_directories('..')] @@ -10,7 +10,7 @@ dhcp_run_script_libload_tests = executable( f'-DLIBRUN_SCRIPT_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/run_script/libdhcp_run_script.so"', f'-DRUN_SCRIPT_TEST_SH="@TOP_BUILD_DIR@/src/hooks/dhcp/run_script/tests/run_script_test.sh"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/run_script/meson.build b/src/hooks/dhcp/run_script/meson.build index 30c7c84955..8dc2667034 100644 --- a/src/hooks/dhcp/run_script/meson.build +++ b/src/hooks/dhcp/run_script/meson.build @@ -5,7 +5,7 @@ dhcp_run_script_lib = shared_library( 'run_script_log.cc', 'run_script_messages.cc', 'version.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/run_script/tests/meson.build b/src/hooks/dhcp/run_script/tests/meson.build index c0e5541e0d..55f1296d04 100644 --- a/src/hooks/dhcp/run_script/tests/meson.build +++ b/src/hooks/dhcp/run_script/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -20,7 +20,7 @@ dhcp_run_script_lib_tests = executable( f'-DTEST_LOG_FILE="@current_build_dir@/test.log"', f'-DRUN_SCRIPT_TEST_SH="@current_build_dir@/run_script_test.sh"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_run_script_archive] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/stat_cmds/libloadtests/meson.build b/src/hooks/dhcp/stat_cmds/libloadtests/meson.build index dfdee11bfc..260d871ea3 100644 --- a/src/hooks/dhcp/stat_cmds/libloadtests/meson.build +++ b/src/hooks/dhcp/stat_cmds/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -9,7 +9,7 @@ dhcp_stat_cmds_libload_tests = executable( cpp_args: [ f'-DLIBDHCP_STAT_CMDS_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/stat_cmds/libdhcp_stat_cmds.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/stat_cmds/meson.build b/src/hooks/dhcp/stat_cmds/meson.build index a43d130d3b..7de7423dbc 100644 --- a/src/hooks/dhcp/stat_cmds/meson.build +++ b/src/hooks/dhcp/stat_cmds/meson.build @@ -5,7 +5,7 @@ dhcp_stat_cmds_lib = shared_library( 'stat_cmds_log.cc', 'stat_cmds_messages.cc', 'version.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/stat_cmds/tests/meson.build b/src/hooks/dhcp/stat_cmds/tests/meson.build index 56002a5896..8ae3289a7a 100644 --- a/src/hooks/dhcp/stat_cmds/tests/meson.build +++ b/src/hooks/dhcp/stat_cmds/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -9,7 +9,7 @@ dhcp_stat_cmds_lib_tests = executable( cpp_args: [ f'-DSTAT_CMDS_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/stat_cmds/libdhcp_stat_cmds.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_stat_cmds_archive] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/subnet_cmds/libloadtests/meson.build b/src/hooks/dhcp/subnet_cmds/libloadtests/meson.build index f00b1f8192..154de07935 100644 --- a/src/hooks/dhcp/subnet_cmds/libloadtests/meson.build +++ b/src/hooks/dhcp/subnet_cmds/libloadtests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -9,7 +9,7 @@ dhcp_subnet_cmds_libloadtests = executable( cpp_args: [ f'-DLIBDHCP_SUBNET_CMDS_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/subnet_cmds/libdhcp_subnet_cmds.so"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/subnet_cmds/meson.build b/src/hooks/dhcp/subnet_cmds/meson.build index 5c13a65a1f..f24fcb40e4 100644 --- a/src/hooks/dhcp/subnet_cmds/meson.build +++ b/src/hooks/dhcp/subnet_cmds/meson.build @@ -5,7 +5,7 @@ dhcp_subnet_cmds_lib = shared_library( 'subnet_cmds_log.cc', 'subnet_cmds_messages.cc', 'version.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib/kea/hooks', diff --git a/src/hooks/dhcp/subnet_cmds/tests/meson.build b/src/hooks/dhcp/subnet_cmds/tests/meson.build index ad53609f88..35cb6935f4 100644 --- a/src/hooks/dhcp/subnet_cmds/tests/meson.build +++ b/src/hooks/dhcp/subnet_cmds/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -13,7 +13,7 @@ dhcp_subnet_cmds_tests = executable( cpp_args: [ f'-DLIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/subnet_cmds/libdhcp_subnet_cmds.so"', ], - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_subnet_cmds_tests_libs] + LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/user_chk/tests/meson.build b/src/hooks/dhcp/user_chk/tests/meson.build index d37bf02202..c59dfdc157 100644 --- a/src/hooks/dhcp/user_chk/tests/meson.build +++ b/src/hooks/dhcp/user_chk/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -19,7 +19,7 @@ dhcp_user_chk_lib_tests = executable( 'user_unittests.cc', 'userid_unittests.cc', cpp_args: [f'-DTEST_DATA_BUILDDIR="@current_build_dir@"'], - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.'), include_directories('..')] + INCLUDES, link_with: [dhcp_user_chk_archive] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/asiodns/tests/meson.build b/src/lib/asiodns/tests/meson.build index a572aec8d8..a1068c7d48 100644 --- a/src/lib/asiodns/tests/meson.build +++ b/src/lib/asiodns/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -6,7 +6,7 @@ kea_asiodns_tests = executable( 'kea-asiodns-tests', 'io_fetch_unittest.cc', 'run_unittests.cc', - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_testutils_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/asiolink/meson.build b/src/lib/asiolink/meson.build index bb20eb2119..57f4d5c22b 100644 --- a/src/lib/asiolink/meson.build +++ b/src/lib/asiolink/meson.build @@ -14,7 +14,7 @@ kea_asiolink_lib = shared_library( 'openssl_tls.cc', 'process_spawn.cc', 'unix_domain_socket.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib', diff --git a/src/lib/asiolink/tests/meson.build b/src/lib/asiolink/tests/meson.build index e90aa9001a..4bc325a06c 100644 --- a/src/lib/asiolink/tests/meson.build +++ b/src/lib/asiolink/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -37,7 +37,7 @@ kea_asiolink_tests = executable( f'-DINVALID_TEST_SCRIPT_SH="@TOP_SOURCE_DIR@/README"', f'-DTEST_CA_DIR="@TEST_CA_DIR@"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_asiolink_testutils_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/asiolink/testutils/meson.build b/src/lib/asiolink/testutils/meson.build index 49c1fb7887..4e6a050c09 100644 --- a/src/lib/asiolink/testutils/meson.build +++ b/src/lib/asiolink/testutils/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -8,16 +8,16 @@ kea_asiolink_testutils_lib = static_library( 'test_server_unix_socket.cc', 'timed_signal.cc', cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'], - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, ) -if crypto.name() == openssl.name() +if CRYPTO_DEP.name() == openssl.name() executable( 'openssl_sample_client', 'openssl_sample_client.cc', cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'], - dependencies: [gtest, openssl], + dependencies: [GTEST_DEP, openssl], include_directories: [include_directories('.')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) @@ -25,16 +25,16 @@ if crypto.name() == openssl.name() 'openssl_sample_server', 'openssl_sample_server.cc', cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'], - dependencies: [gtest, openssl], + dependencies: [GTEST_DEP, openssl], include_directories: [include_directories('.')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) -elif crypto.name() == botan.name() +elif CRYPTO_DEP.name() == botan.name() executable( 'botan_sample_client', 'botan_sample_client.cc', cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'], - dependencies: [gtest, botan], + dependencies: [GTEST_DEP, botan], include_directories: [include_directories('.')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) @@ -42,7 +42,7 @@ elif crypto.name() == botan.name() 'botan_sample_server', 'botan_sample_server.cc', cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'], - dependencies: [gtest, botan], + dependencies: [GTEST_DEP, botan], include_directories: [include_directories('.')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/cc/meson.build b/src/lib/cc/meson.build index b7a925a244..b59ddd6ce4 100644 --- a/src/lib/cc/meson.build +++ b/src/lib/cc/meson.build @@ -1,5 +1,5 @@ kea_cc_lib_cpp_args = [] -if gtest.found() +if TESTS_OPT.enabled() kea_cc_lib_cpp_args = ['-DALLOW_KEATEST'] endif kea_cc_lib = shared_library( diff --git a/src/lib/cc/tests/meson.build b/src/lib/cc/tests/meson.build index d2c2ce18c9..07a2f8f5f0 100644 --- a/src/lib/cc/tests/meson.build +++ b/src/lib/cc/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -15,7 +15,7 @@ kea_cc_tests = executable( 'stamped_element_unittest.cc', 'stamped_value_unittest.cc', 'user_context_unittests.cc', - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/config/meson.build b/src/lib/config/meson.build index 6e04771c32..fcb7c94800 100644 --- a/src/lib/config/meson.build +++ b/src/lib/config/meson.build @@ -13,7 +13,7 @@ kea_config_lib = shared_library( 'http_command_response_creator.cc', 'unix_command_config.cc', 'unix_command_mgr.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib', diff --git a/src/lib/config/tests/meson.build b/src/lib/config/tests/meson.build index 3d6122e7bf..276f21cb03 100644 --- a/src/lib/config/tests/meson.build +++ b/src/lib/config/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -18,7 +18,7 @@ kea_config_tests = executable( 'run_unittests.cc', 'unix_command_config_unittests.cc', 'unix_command_mgr_unittests.cc', - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], cpp_args: [ f'-DTEST_DATA_BUILDDIR="@current_build_dir@"', f'-DTEST_CA_DIR="@TEST_CA_DIR@"', diff --git a/src/lib/config_backend/tests/meson.build b/src/lib/config_backend/tests/meson.build index b631319233..b43544e9ad 100644 --- a/src/lib/config_backend/tests/meson.build +++ b/src/lib/config_backend/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -6,7 +6,7 @@ kea_config_backend_tests = executable( 'kea-config_backend-tests', 'config_backend_mgr_unittest.cc', 'run_unittests.cc', - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_testutils_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/cryptolink/meson.build b/src/lib/cryptolink/meson.build index 969ee365e5..bb6513c702 100644 --- a/src/lib/cryptolink/meson.build +++ b/src/lib/cryptolink/meson.build @@ -1,7 +1,7 @@ sources = [] -if crypto.name() == botan.name() +if CRYPTO_DEP.name() == botan.name() sources += ['botan_hash.cc', 'botan_hmac.cc', 'botan_link.cc'] -elif crypto.name() == openssl.name() +elif CRYPTO_DEP.name() == openssl.name() sources += ['openssl_hash.cc', 'openssl_hmac.cc', 'openssl_link.cc'] endif @@ -12,7 +12,7 @@ kea_cryptolink_lib = shared_library( 'crypto_hmac.cc', 'crypto_rng.cc', sources, - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib', diff --git a/src/lib/cryptolink/tests/meson.build b/src/lib/cryptolink/tests/meson.build index 7dca395f57..e05fe7efd7 100644 --- a/src/lib/cryptolink/tests/meson.build +++ b/src/lib/cryptolink/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -8,7 +8,7 @@ kea_cryptolink_tests = executable( 'hash_unittests.cc', 'hmac_unittests.cc', 'run_unittests.cc', - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/d2srv/meson.build b/src/lib/d2srv/meson.build index 7108933024..564d26b4b4 100644 --- a/src/lib/d2srv/meson.build +++ b/src/lib/d2srv/meson.build @@ -11,7 +11,7 @@ kea_d2srv_lib = shared_library( 'd2_zone.cc', 'dns_client.cc', 'nc_trans.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib', diff --git a/src/lib/d2srv/tests/meson.build b/src/lib/d2srv/tests/meson.build index ea0ed7e242..e2fafa4933 100644 --- a/src/lib/d2srv/tests/meson.build +++ b/src/lib/d2srv/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -11,7 +11,7 @@ kea_d2srv_tests = executable( 'd2_zone_unittests.cc', 'dns_client_unittests.cc', 'nc_trans_unittests.cc', - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib, libs_testutils] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/d2srv/testutils/meson.build b/src/lib/d2srv/testutils/meson.build index 6cfd0720b8..06065a04fa 100644 --- a/src/lib/d2srv/testutils/meson.build +++ b/src/lib/d2srv/testutils/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -6,6 +6,6 @@ kea_d2srv_testutils_lib = static_library( 'kea-d2srv-testutils', 'nc_test_utils.cc', 'stats_test_utils.cc', - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, ) diff --git a/src/lib/database/tests/meson.build b/src/lib/database/tests/meson.build index 5f8e86833b..1f9a4649e7 100644 --- a/src/lib/database/tests/meson.build +++ b/src/lib/database/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -12,7 +12,7 @@ kea_database_tests = executable( 'run_unittests.cc', 'server_selector_unittest.cc', 'server_unittest.cc', - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_testutils_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/database/testutils/meson.build b/src/lib/database/testutils/meson.build index 8390b6ca7f..f11417a4d7 100644 --- a/src/lib/database/testutils/meson.build +++ b/src/lib/database/testutils/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -6,6 +6,6 @@ kea_database_testutils_lib = static_library( 'kea-database-testutils', 'schema.cc', cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'], - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, ) diff --git a/src/lib/dhcp/tests/meson.build b/src/lib/dhcp/tests/meson.build index 2980fe56e7..3df8728dde 100644 --- a/src/lib/dhcp/tests/meson.build +++ b/src/lib/dhcp/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -61,7 +61,7 @@ kea_dhcp_tests = executable( 'protocol_util_unittest.cc', 'run_unittests.cc', pkt_filter_xpf_unittest_cc, - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], cpp_args: [f'-DTEST_DATA_BUILDDIR="@current_build_dir@"'], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib, libs_testutils] + LIBS_BUILT_SO_FAR, diff --git a/src/lib/dhcp/testutils/meson.build b/src/lib/dhcp/testutils/meson.build index ad77e49fa5..74fba554c4 100644 --- a/src/lib/dhcp/testutils/meson.build +++ b/src/lib/dhcp/testutils/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -9,6 +9,6 @@ kea_dhcp_testutils_lib = static_library( 'pkt_captures6.cc', 'pkt_filter6_test_stub.cc', 'pkt_filter_test_stub.cc', - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, ) diff --git a/src/lib/dhcp_ddns/tests/meson.build b/src/lib/dhcp_ddns/tests/meson.build index 8d343aa8d5..6b3d2bf06f 100644 --- a/src/lib/dhcp_ddns/tests/meson.build +++ b/src/lib/dhcp_ddns/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -8,7 +8,7 @@ kea_dhcp_ddns_tests = executable( 'ncr_unittests.cc', 'run_unittests.cc', 'test_utils.cc', - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_testutils_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/dhcpsrv/meson.build b/src/lib/dhcpsrv/meson.build index e5e1ee2dd3..46fae580ee 100644 --- a/src/lib/dhcpsrv/meson.build +++ b/src/lib/dhcpsrv/meson.build @@ -92,7 +92,7 @@ kea_dhcpsrv_lib = shared_library( f'-DDHCP_DATA_DIR="@DHCP_DATA_DIR@"', f'-DKEA_LFC_EXECUTABLE="@KEA_LFC@"', ], - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib', diff --git a/src/lib/dhcpsrv/tests/meson.build b/src/lib/dhcpsrv/tests/meson.build index 41e7c402f5..3557286336 100644 --- a/src/lib/dhcpsrv/tests/meson.build +++ b/src/lib/dhcpsrv/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -128,7 +128,7 @@ kea_dhcpsrv_tests = executable( f'-DKEA_LFC_BUILD_DIR="@TOP_BUILD_DIR@/src/bin/lfc"', f'-DDEFAULT_HOOKS_PATH="@DEFAULT_HOOKS_PATH@"', ], - dependencies: [crypto, gtest], + dependencies: [CRYPTO_DEP, GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib, libs_testutils] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/dhcpsrv/testutils/meson.build b/src/lib/dhcpsrv/testutils/meson.build index 00aac1dbbb..c0b5c57027 100644 --- a/src/lib/dhcpsrv/testutils/meson.build +++ b/src/lib/dhcpsrv/testutils/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -20,14 +20,14 @@ sources = [ 'test_config_backend_dhcp6.cc', 'test_utils.cc', ] -dependencies = [crypto, gtest] -if mysql.found() +dependencies = [CRYPTO_DEP, GTEST_DEP] +if MYSQL_DEP.found() sources += ['mysql_generic_backend_unittest.cc'] - dependencies += [mysql] + dependencies += [MYSQL_DEP] endif -if postgresql.found() +if POSTGRESQL_DEP.found() sources += ['pgsql_generic_backend_unittest.cc'] - dependencies += [postgresql] + dependencies += [POSTGRESQL_DEP] endif kea_dhcpsrv_testutils_lib = static_library( 'kea-dhcpsrv-testutils', diff --git a/src/lib/dns/tests/meson.build b/src/lib/dns/tests/meson.build index 70c6502c0d..eb1021567e 100644 --- a/src/lib/dns/tests/meson.build +++ b/src/lib/dns/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -50,7 +50,7 @@ kea_dns_tests = executable( f'-DTEST_DATA_BUILDDIR="@TOP_BUILD_DIR@/src/lib/dns/tests/testdata"', f'-DTEST_DATA_SRCDIR="@TOP_SOURCE_DIR@/src/lib/dns/tests/testdata"', ], - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/eval/tests/meson.build b/src/lib/eval/tests/meson.build index b603884768..f020ac0b30 100644 --- a/src/lib/eval/tests/meson.build +++ b/src/lib/eval/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -10,7 +10,7 @@ kea_eval_tests = executable( 'evaluate_unittest.cc', 'run_unittests.cc', 'token_unittest.cc', - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_testutils_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/exceptions/tests/meson.build b/src/lib/exceptions/tests/meson.build index b8432129f9..788e52adc4 100644 --- a/src/lib/exceptions/tests/meson.build +++ b/src/lib/exceptions/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -6,7 +6,7 @@ kea_exceptions_tests = executable( 'kea-exceptions-tests', 'exceptions_unittest.cc', 'run_unittests.cc', - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/hooks/tests/meson.build b/src/lib/hooks/tests/meson.build index fa32e2444d..eb56f8e36c 100644 --- a/src/lib/hooks/tests/meson.build +++ b/src/lib/hooks/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -110,7 +110,7 @@ kea_hooks_tests = executable( 'parking_lots_unittest.cc', 'run_unittests.cc', 'server_hooks_unittest.cc', - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/http/meson.build b/src/lib/http/meson.build index 43f168f80b..c8576cb315 100644 --- a/src/lib/http/meson.build +++ b/src/lib/http/meson.build @@ -25,7 +25,7 @@ kea_http_lib = shared_library( 'response_json.cc', 'response_parser.cc', 'url.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib', diff --git a/src/lib/http/tests/meson.build b/src/lib/http/tests/meson.build index aca510d0d0..86a6565236 100644 --- a/src/lib/http/tests/meson.build +++ b/src/lib/http/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -30,7 +30,7 @@ kea_http_tests = executable( f'-DTEST_CA_DIR="@TEST_CA_DIR@"', f'-DDATA_DIR="@current_source_dir@/testdata"', ], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib, libs_testutils] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/log/interprocess/tests/meson.build b/src/lib/log/interprocess/tests/meson.build index c0f0b1d00c..0381d60cb6 100644 --- a/src/lib/log/interprocess/tests/meson.build +++ b/src/lib/log/interprocess/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -8,7 +8,7 @@ kea_log_interprocess_tests = executable( 'interprocess_sync_null_unittest.cc', 'run_unittests.cc', cpp_args: [f'-DTEST_DATA_TOPBUILDDIR="@TOP_BUILD_DIR@"'], - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/log/meson.build b/src/lib/log/meson.build index a53333f0d2..ae66436254 100644 --- a/src/lib/log/meson.build +++ b/src/lib/log/meson.build @@ -20,7 +20,7 @@ kea_log_lib = shared_library( 'message_reader.cc', 'output_option.cc', cpp_args: [f'-DTOP_BUILDDIR="@TOP_BUILD_DIR@"'], - dependencies: [log4cplus], + dependencies: [LOG4CPLUS_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib', diff --git a/src/lib/log/tests/meson.build b/src/lib/log/tests/meson.build index 3409d51ec8..777fcfc698 100644 --- a/src/lib/log/tests/meson.build +++ b/src/lib/log/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -19,7 +19,7 @@ kea_log_tests = executable( 'output_option_unittest.cc', 'run_unittests.cc', cpp_args: [f'-DTEMP_DIR="@TOP_BUILD_DIR@"'], - dependencies: [gtest, log4cplus], + dependencies: [GTEST_DEP, LOG4CPLUS_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) @@ -30,7 +30,7 @@ kea_log_init_tests = executable( 'run_initializer_unittests.cc', 'message_initializer_1_unittest.cc', 'message_initializer_1a_unittest.cc', - dependencies: [gtest, log4cplus], + dependencies: [GTEST_DEP, LOG4CPLUS_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/mysql/meson.build b/src/lib/mysql/meson.build index a3984cc818..7420bd139e 100644 --- a/src/lib/mysql/meson.build +++ b/src/lib/mysql/meson.build @@ -1,4 +1,4 @@ -if not mysql.found() +if not MYSQL_DEP.found() subdir_done() endif @@ -7,7 +7,7 @@ kea_mysql_lib = shared_library( 'mysql_binding.cc', 'mysql_connection.cc', cpp_args: [f'-DKEA_ADMIN="@KEA_ADMIN@"'], - dependencies: [mysql], + dependencies: [MYSQL_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib', diff --git a/src/lib/mysql/tests/meson.build b/src/lib/mysql/tests/meson.build index 74b8be3aaf..9ee4081901 100644 --- a/src/lib/mysql/tests/meson.build +++ b/src/lib/mysql/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() or not mysql.found() +if not TESTS_OPT.enabled() or not MYSQL_DEP.found() subdir_done() endif @@ -13,7 +13,7 @@ kea_mysql_tests = executable( 'mysql_connection_unittest.cc', 'run_unittests.cc', cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"', f'-DKEA_ADMIN="@KEA_ADMIN@"'], - dependencies: [gtest, mysql], + dependencies: [GTEST_DEP, MYSQL_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib, libs_testutils] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/mysql/testutils/meson.build b/src/lib/mysql/testutils/meson.build index 942b067e3d..933b9dcdaa 100644 --- a/src/lib/mysql/testutils/meson.build +++ b/src/lib/mysql/testutils/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() or not mysql.found() +if not TESTS_OPT.enabled() or not MYSQL_DEP.found() subdir_done() endif @@ -9,6 +9,6 @@ kea_mysql_testutils_lib = static_library( f'-DDATABASE_SCRIPTS_DIR="@DATABASE_SCRIPTS_DIR@"', f'-DDATABASE_WIPE_DIR="@DATABASE_SCRIPTS_DIR@"', ], - dependencies: [gtest, mysql], + dependencies: [GTEST_DEP, MYSQL_DEP], include_directories: [include_directories('.')] + INCLUDES, ) diff --git a/src/lib/pgsql/meson.build b/src/lib/pgsql/meson.build index daf1c8a040..644c2669e3 100644 --- a/src/lib/pgsql/meson.build +++ b/src/lib/pgsql/meson.build @@ -1,4 +1,4 @@ -if not postgresql.found() +if not POSTGRESQL_DEP.found() subdir_done() endif @@ -7,7 +7,7 @@ kea_pgsql_lib = shared_library( 'pgsql_connection.cc', 'pgsql_exchange.cc', cpp_args: [f'-DKEA_ADMIN="@KEA_ADMIN@"'], - dependencies: [postgresql], + dependencies: [POSTGRESQL_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib', diff --git a/src/lib/pgsql/tests/meson.build b/src/lib/pgsql/tests/meson.build index 56ef940d24..18ed926da4 100644 --- a/src/lib/pgsql/tests/meson.build +++ b/src/lib/pgsql/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() or not postgresql.found() +if not TESTS_OPT.enabled() or not POSTGRESQL_DEP.found() subdir_done() endif @@ -14,7 +14,7 @@ kea_pgsql_tests = executable( 'pgsql_exchange_unittest.cc', 'run_unittests.cc', cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"', f'-DKEA_ADMIN="@KEA_ADMIN@"'], - dependencies: [gtest, postgresql], + dependencies: [GTEST_DEP, POSTGRESQL_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib, libs_testutils] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/pgsql/testutils/meson.build b/src/lib/pgsql/testutils/meson.build index 9966acc492..8bc4c9c8da 100644 --- a/src/lib/pgsql/testutils/meson.build +++ b/src/lib/pgsql/testutils/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() or not postgresql.found() +if not TESTS_OPT.enabled() or not POSTGRESQL_DEP.found() subdir_done() endif @@ -9,6 +9,6 @@ kea_pgsql_testutils_lib = static_library( f'-DDATABASE_SCRIPTS_DIR="@DATABASE_SCRIPTS_DIR@"', f'-DDATABASE_WIPE_DIR="@DATABASE_SCRIPTS_DIR@"', ], - dependencies: [gtest, postgresql], + dependencies: [GTEST_DEP, POSTGRESQL_DEP], include_directories: [include_directories('.')] + INCLUDES, ) diff --git a/src/lib/process/cfgrpt/tests/meson.build b/src/lib/process/cfgrpt/tests/meson.build index 0cef9dc616..29f6f2a90e 100644 --- a/src/lib/process/cfgrpt/tests/meson.build +++ b/src/lib/process/cfgrpt/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -6,7 +6,7 @@ kea_process_cfgrpt_tests = executable( 'kea-process-cfgrpt-tests', 'config_report_unittests.cc', 'run_unittests.cc', - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/process/meson.build b/src/lib/process/meson.build index 7b3c896638..a1f48887c4 100644 --- a/src/lib/process/meson.build +++ b/src/lib/process/meson.build @@ -13,7 +13,7 @@ kea_process_lib = shared_library( 'process_messages.cc', 'redact_config.cc', cpp_args: [f'-DDATA_DIR="@DHCP_DATA_DIR@"'], - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib', diff --git a/src/lib/process/tests/meson.build b/src/lib/process/tests/meson.build index dcf605506a..4c6aecb7d8 100644 --- a/src/lib/process/tests/meson.build +++ b/src/lib/process/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -21,7 +21,7 @@ kea_process_tests = executable( 'log_parser_unittests.cc', 'logging_info_unittests.cc', 'run_unittests.cc', - dependencies: [gtest], + dependencies: [GTEST_DEP], cpp_args: [ f'-DTEST_DATA_BUILDDIR="@current_build_dir@"', f'-DTEST_SCRIPT_SH="@current_build_dir@/process_test.sh"', diff --git a/src/lib/process/testutils/meson.build b/src/lib/process/testutils/meson.build index cad4700a26..c140a3f841 100644 --- a/src/lib/process/testutils/meson.build +++ b/src/lib/process/testutils/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -6,6 +6,6 @@ kea_process_testutils_lib = static_library( 'kea-process-testutils', 'd_test_stubs.cc', cpp_args: [f'-DDATABASE_SCRIPTS_DIR="@DATABASE_SCRIPTS_DIR@"'], - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, ) diff --git a/src/lib/stats/tests/meson.build b/src/lib/stats/tests/meson.build index dbba79be84..82a29c3be5 100644 --- a/src/lib/stats/tests/meson.build +++ b/src/lib/stats/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -8,7 +8,7 @@ kea_stats_tests = executable( 'observation_unittest.cc', 'run_unittests.cc', 'stats_mgr_unittest.cc', - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_testutils_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/tcp/meson.build b/src/lib/tcp/meson.build index 9c84af5ded..0d615c7dd6 100644 --- a/src/lib/tcp/meson.build +++ b/src/lib/tcp/meson.build @@ -7,7 +7,7 @@ kea_tcp_lib = shared_library( 'tcp_log.cc', 'tcp_messages.cc', 'tcp_stream_msg.cc', - dependencies: [crypto], + dependencies: [CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib', diff --git a/src/lib/tcp/tests/meson.build b/src/lib/tcp/tests/meson.build index 80e98bbdf1..0e3cc18aad 100644 --- a/src/lib/tcp/tests/meson.build +++ b/src/lib/tcp/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -8,7 +8,7 @@ kea_tcp_tests = executable( 'run_unittests.cc', 'tcp_listener_unittests.cc', cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'], - dependencies: [gtest, crypto], + dependencies: [GTEST_DEP, CRYPTO_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib, kea_asiolink_testutils_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/testutils/meson.build b/src/lib/testutils/meson.build index 0e3e494997..e6b8d673ff 100644 --- a/src/lib/testutils/meson.build +++ b/src/lib/testutils/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not FUZZ_OPT.enabled() and not TESTS_OPT.enabled() subdir_done() endif @@ -10,7 +10,7 @@ kea_testutils_lib = static_library( 'threaded_test.cc', 'unix_control_client.cc', 'user_context_utils.cc', - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, ) diff --git a/src/lib/util/tests/meson.build b/src/lib/util/tests/meson.build index 190946a806..9c2ce19a28 100644 --- a/src/lib/util/tests/meson.build +++ b/src/lib/util/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -40,7 +40,7 @@ kea_util_tests = executable( f'-DABS_SRCDIR="@TOP_SOURCE_DIR@/src/lib/util/tests"', f'-DTEST_DATA_BUILDDIR="@TOP_BUILD_DIR@/src/lib/util/tests"', ], - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/util/unittests/meson.build b/src/lib/util/unittests/meson.build index 47c2ef02e1..d14b91b192 100644 --- a/src/lib/util/unittests/meson.build +++ b/src/lib/util/unittests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() +if not TESTS_OPT.enabled() subdir_done() endif @@ -12,6 +12,6 @@ kea_util_unittests_lib = static_library( 'run_all.cc', 'testdata.cc', 'wiredata.cc', - dependencies: [gtest], + dependencies: [GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, ) diff --git a/src/lib/yang/meson.build b/src/lib/yang/meson.build index cf0670d391..af1a5f2725 100644 --- a/src/lib/yang/meson.build +++ b/src/lib/yang/meson.build @@ -1,4 +1,4 @@ -if not NETCONF_DEPS_FOUND +if not NETCONF_DEP.found() subdir_done() endif @@ -23,7 +23,7 @@ kea_yang_lib = shared_library( 'translator_pool.cc', 'translator_shared_network.cc', 'translator_subnet.cc', - dependencies: NETCONF_DEPS_ARRAY, + dependencies: NETCONF_DEP, include_directories: [include_directories('.')] + INCLUDES, install: true, install_dir: 'lib', diff --git a/src/lib/yang/pretests/meson.build b/src/lib/yang/pretests/meson.build index 39feb10044..7e53d904a6 100644 --- a/src/lib/yang/pretests/meson.build +++ b/src/lib/yang/pretests/meson.build @@ -1,11 +1,11 @@ -if not gtest.found() or not NETCONF_DEPS_FOUND +if not TESTS_OPT.enabled() or not NETCONF_DEP.found() subdir_done() endif sysrepo_setup_tests = executable( 'kea-sysrepo-setup-tests', 'sysrepo_setup_tests.cc', - dependencies: NETCONF_DEPS_ARRAY + [gtest], + dependencies: [NETCONF_DEP, GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, override_options: ['cpp_std=c++20'], ) diff --git a/src/lib/yang/tests/meson.build b/src/lib/yang/tests/meson.build index 8e1e0eb190..d6d03abe86 100644 --- a/src/lib/yang/tests/meson.build +++ b/src/lib/yang/tests/meson.build @@ -1,4 +1,4 @@ -if not gtest.found() or not NETCONF_DEPS_FOUND +if not TESTS_OPT.enabled() or not NETCONF_DEP.found() subdir_done() endif @@ -31,7 +31,7 @@ kea_yang_tests = executable( 'translator_unittests.cc', 'translator_utils_unittests.cc', cpp_args: [f'-DCFG_EXAMPLES="@TOP_SOURCE_DIR@/doc/examples"'], - dependencies: NETCONF_DEPS_ARRAY + [gtest], + dependencies: [NETCONF_DEP, GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, link_with: [kea_yang_tests_libs] + LIBS_BUILT_SO_FAR, override_options: ['cpp_std=c++20'], diff --git a/src/lib/yang/testutils/meson.build b/src/lib/yang/testutils/meson.build index 4db038eccc..d58a0468b8 100644 --- a/src/lib/yang/testutils/meson.build +++ b/src/lib/yang/testutils/meson.build @@ -1,11 +1,11 @@ -if not gtest.found() or not NETCONF_DEPS_FOUND +if not TESTS_OPT.enabled() or not NETCONF_DEP.found() subdir_done() endif kea_yang_testutils_lib = static_library( 'kea-yang-testutils', 'translator_test.cc', - dependencies: NETCONF_DEPS_ARRAY + [gtest], + dependencies: [NETCONF_DEP, GTEST_DEP], include_directories: [include_directories('.')] + INCLUDES, override_options: ['cpp_std=c++20'], ) diff --git a/src/share/yang/modules/meson.build b/src/share/yang/modules/meson.build index 0ee2cb33b0..0bfec70cad 100644 --- a/src/share/yang/modules/meson.build +++ b/src/share/yang/modules/meson.build @@ -1,4 +1,4 @@ -if not NETCONF_DEPS_FOUND +if not NETCONF_DEP.found() subdir_done() endif diff --git a/src/share/yang/modules/utils/meson.build b/src/share/yang/modules/utils/meson.build index a2cf62c245..9b24164edb 100644 --- a/src/share/yang/modules/utils/meson.build +++ b/src/share/yang/modules/utils/meson.build @@ -8,11 +8,11 @@ yang_utils_conf_data.set('datarootdir', f'@PREFIX@/@DATADIR@') yang_utils_conf_data.set('prefix', PREFIX) yang_utils_conf_data.set( 'LIBYANG_PREFIX', - netconf_deps['yang'].get_variable('prefix'), + NETCONF_DEP.get_variable('libyang_prefix'), ) yang_utils_conf_data.set( 'SYSREPO_PREFIX', - netconf_deps['sysrepo'].get_variable('prefix'), + NETCONF_DEP.get_variable('sysrepo_prefix'), ) configure_file( diff --git a/subprojects/krb5/meson.build b/subprojects/krb5/meson.build new file mode 100644 index 0000000000..0041463ac9 --- /dev/null +++ b/subprojects/krb5/meson.build @@ -0,0 +1,16 @@ +project('krb5') +krb5 = disabler() +krb5_config = find_program('krb5-config', required: false) +if krb5_config.found() + cflags = run_command([krb5_config, '--cflags', 'gssapi'], check: false) + libs = run_command([krb5_config, '--libs', 'gssapi'], check: false) + version = run_command([krb5_config, '--version'], check: false) + if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0 + krb5_version = version.stdout().strip() + krb5 = declare_dependency( + compile_args: cflags.stdout().split(), + link_args: libs.stdout().split(), + version: krb5_version, + ) + endif +endif diff --git a/subprojects/log4cplus/meson.build b/subprojects/log4cplus/meson.build new file mode 100644 index 0000000000..34bc1c4bbd --- /dev/null +++ b/subprojects/log4cplus/meson.build @@ -0,0 +1,2 @@ +project('log4cplus') +log4cplus = cpp.find_library('log4cplus', required: false) diff --git a/subprojects/mysql/meson.build b/subprojects/mysql/meson.build new file mode 100644 index 0000000000..c750b9f459 --- /dev/null +++ b/subprojects/mysql/meson.build @@ -0,0 +1,30 @@ +project('mysql') +mysql = disabler() +if not MYSQL_DEP.found() + mysql = dependency('mysql', required: false) +endif +foreach mysql_config_file : ['mariadb_config', 'mysql_config'] + if MYSQL_DEP.found() + continue + endif + mysql_config = find_program(mysql_config_file, required: false) + if not mysql_config.found() + continue + endif + cflags = run_command([mysql_config, '--cflags'], check: false) + libs = run_command([mysql_config, '--libs'], check: false) + version = run_command([mysql_config, '--version'], check: false) + + if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0 + mysql_compile_args = cflags.stdout().split() + mysql_link_args = libs.stdout().split() + mysql_version = version.stdout().strip() + mysql = declare_dependency( + compile_args: mysql_compile_args, + link_args: mysql_link_args, + version: mysql_version, + ) + break + endif +endforeach + diff --git a/subprojects/netconf/meson.build b/subprojects/netconf/meson.build new file mode 100644 index 0000000000..12c3e03e69 --- /dev/null +++ b/subprojects/netconf/meson.build @@ -0,0 +1,72 @@ +project('netconf') +cpp = meson.get_compiler('cpp') +SYSTEM = build_machine.system() + +netconf_deps = {} + +foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp'] + netconf_deps = netconf_deps + {dep: dependency(dep, required: false)} + if netconf_deps[dep].found() + continue + endif + + # Try adding lib to it. libyang and libyang-cpp define the wrong pkg-config. + netconf_deps = netconf_deps + { + dep: dependency('lib' + dep, required: false), + } + if netconf_deps[dep].found() + continue + endif + + # Search in /opt. + foreach prefix : ['', 'lib'] + path = f'/opt/@prefix@@dep@' + lib = cpp.find_library(dep, dirs: [f'/@path@/lib'], required: false) + if lib.found() + netconf_deps = netconf_deps + { + dep: declare_dependency( + dependencies: [lib], + include_directories: include_directories(f'/@path@/include'), + variables: {'prefix': f'@path@'}, + ), + } + if SYSTEM == 'darwin' + add_project_link_arguments( + f'-Wl,-rpath,@path@/lib', + language: 'cpp', + ) + else + add_project_link_arguments( + f'-Wl,-rpath=@path@/lib', + language: 'cpp', + ) + endif + endif + endforeach +endforeach + +all_deps_found = true +foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp'] + if not netconf_deps[dep].found() + all_deps_found = false + break + endif +endforeach + +if all_deps_found + netconf = declare_dependency( + dependencies: [ + netconf_deps['yang'], + netconf_deps['yang-cpp'], + netconf_deps['sysrepo'], + netconf_deps['sysrepo-cpp'], + ], + variables: { + 'libyang_prefix': netconf_deps['yang'].found() ? netconf_deps['yang'].get_variable('prefix') : 'unknown', + 'sysrepo_prefix': netconf_deps['sysrepo'].found() ? netconf_deps['sysrepo'].get_variable('prefix') : 'unknown', + }, + ) +else + netconf = disabler() +endif + diff --git a/subprojects/postgresql/meson.build b/subprojects/postgresql/meson.build new file mode 100644 index 0000000000..2d65a8595f --- /dev/null +++ b/subprojects/postgresql/meson.build @@ -0,0 +1,18 @@ +project('postgresql') +postgresql = disabler() +pg_config = find_program('pg_config', required: false) +if pg_config.found() + cflags = run_command([pg_config, '--cflags'], check: false) + libs = run_command([pg_config, '--libs'], check: false) + version = run_command([pg_config, '--version'], check: false) + if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0 + pgsql_compile_args = cflags.stdout().split() + pgsql_link_args = libs.stdout().split() + pgsql_version = version.stdout().strip() + postgresql = declare_dependency( + compile_args: pgsql_compile_args, + link_args: pgsql_link_args, + version: pgsql_version, + ) + endif +endif