From a846e64be4dd8ceb2728e939e96c6dd05feb5fe7 Mon Sep 17 00:00:00 2001 From: Andrei Pavel Date: Wed, 29 Jan 2025 13:23:29 +0200 Subject: [PATCH] [#3443] Additions to the initial meson Proof of Concept --- compiler-checks/chrono-same-duration.cc | 8 + compiler-checks/have-generic-tls-method.cc | 5 + compiler-checks/have-sa-len.cc | 7 + configure.ac | 1 - kea_version.h.in | 6 +- config.h.in => meson-config.h.in | 14 +- meson-kea_version.h.in | 3 + meson.build | 501 +++++++++++------- src/bin/dhcp4/meson.build | 43 +- src/bin/dhcp6/meson.build | 64 +-- src/bin/lfc/meson.build | 32 +- src/bin/perfdhcp/meson.build | 70 +-- src/hooks/dhcp/bootp/meson.build | 23 +- src/hooks/dhcp/flex_option/meson.build | 28 +- src/hooks/dhcp/high_availability/meson.build | 69 +-- src/hooks/dhcp/lease_cmds/meson.build | 34 +- src/hooks/dhcp/mysql/meson.build | 65 +-- src/hooks/dhcp/perfmon/meson.build | 48 +- src/hooks/dhcp/pgsql/meson.build | 67 +-- src/hooks/dhcp/run_script/meson.build | 28 +- src/hooks/dhcp/stat_cmds/meson.build | 28 +- src/hooks/dhcp/user_chk/meson.build | 45 +- src/lib/asiodns/meson.build | 25 +- src/lib/asiodns/tests/meson.build | 15 +- src/lib/asiolink/meson.build | 105 ++-- src/lib/cc/meson.build | 57 +- src/lib/cc/tests/meson.build | 33 +- src/lib/config/meson.build | 73 +-- src/lib/config_backend/meson.build | 21 +- src/lib/config_backend/tests/meson.build | 15 +- src/lib/cryptolink/meson.build | 53 +- src/lib/cryptolink/tests/meson.build | 19 +- src/lib/d2srv/meson.build | 58 +- src/lib/database/meson.build | 51 +- src/lib/database/tests/meson.build | 27 +- src/lib/dhcp/meson.build | 225 ++++---- src/lib/dhcp_ddns/meson.build | 33 +- src/lib/dhcp_ddns/tests/meson.build | 21 +- src/lib/dhcpsrv/meson.build | 395 +++++++------- src/lib/dns/meson.build | 125 ++--- src/lib/dns/tests/meson.build | 107 ++-- src/lib/eval/meson.build | 45 +- src/lib/eval/tests/meson.build | 23 +- src/lib/exceptions/meson.build | 19 +- src/lib/exceptions/tests/meson.build | 15 +- src/lib/hooks/meson.build | 73 +-- src/lib/http/meson.build | 129 ++--- src/lib/log/compiler/meson.build | 13 +- src/lib/log/interprocess/meson.build | 25 +- src/lib/log/meson.build | 97 ++-- src/lib/log/tests/Makefile.am | 1 + src/lib/log/tests/meson.build | 43 +- src/lib/log/tests/tempdir.h.in | 21 - src/lib/mysql/meson.build | 29 +- src/lib/pgsql/meson.build | 29 +- .../{config_report.cc => config_report.cc.in} | 0 src/lib/process/cfgrpt/meson.build | 25 +- src/lib/process/meson.build | 63 +-- src/lib/stats/meson.build | 25 +- src/lib/stats/tests/meson.build | 19 +- src/lib/tcp/meson.build | 45 +- src/lib/testutils/meson.build | 43 +- src/lib/util/io/meson.build | 17 +- src/lib/util/meson.build | 117 ++-- src/lib/util/tests/meson.build | 82 +-- src/lib/util/unittests/meson.build | 43 +- src/lib/yang/meson.build | 100 ++-- src/share/api/meson.build | 1 + src/share/database/meson.build | 1 + src/share/yang/meson.build | 1 + 70 files changed, 1998 insertions(+), 1793 deletions(-) create mode 100644 compiler-checks/chrono-same-duration.cc create mode 100644 compiler-checks/have-generic-tls-method.cc create mode 100644 compiler-checks/have-sa-len.cc rename config.h.in => meson-config.h.in (97%) create mode 100644 meson-kea_version.h.in delete mode 100644 src/lib/log/tests/tempdir.h.in rename src/lib/process/cfgrpt/{config_report.cc => config_report.cc.in} (100%) diff --git a/compiler-checks/chrono-same-duration.cc b/compiler-checks/chrono-same-duration.cc new file mode 100644 index 0000000000..1e58f1e68a --- /dev/null +++ b/compiler-checks/chrono-same-duration.cc @@ -0,0 +1,8 @@ +#include +#include + +int main() { + static_assert(std::is_same::value, + ""); +} diff --git a/compiler-checks/have-generic-tls-method.cc b/compiler-checks/have-generic-tls-method.cc new file mode 100644 index 0000000000..98b2b2f96f --- /dev/null +++ b/compiler-checks/have-generic-tls-method.cc @@ -0,0 +1,5 @@ +#include + +int main() { + auto _(boost::asio::ssl::context::tls); +} diff --git a/compiler-checks/have-sa-len.cc b/compiler-checks/have-sa-len.cc new file mode 100644 index 0000000000..12f96c9532 --- /dev/null +++ b/compiler-checks/have-sa-len.cc @@ -0,0 +1,7 @@ +#include +#include + +int main() { + struct sockaddr sa; + sa.sa_len = 0; +} diff --git a/configure.ac b/configure.ac index e80f0c0801..7fde06458d 100644 --- a/configure.ac +++ b/configure.ac @@ -1712,7 +1712,6 @@ AC_CONFIG_FILES([src/lib/log/tests/logger_lock_test.sh], [chmod +x src/lib/log/tests/logger_lock_test.sh]) AC_CONFIG_FILES([src/lib/log/tests/severity_test.sh], [chmod +x src/lib/log/tests/severity_test.sh]) -AC_CONFIG_FILES([src/lib/log/tests/tempdir.h]) AC_CONFIG_FILES([src/lib/mysql/Makefile]) AC_CONFIG_FILES([src/lib/mysql/testutils/Makefile]) AC_CONFIG_FILES([src/lib/mysql/tests/Makefile]) diff --git a/kea_version.h.in b/kea_version.h.in index 3f5dc81bf5..cb86e32187 100644 --- a/kea_version.h.in +++ b/kea_version.h.in @@ -1,3 +1,3 @@ -#mesondefine EXTENDED_VERSION -#mesondefine PACKAGE_VERSION_TYPE -#mesondefine PREMIUM_EXTENDED_VERSION +#define EXTENDED_VERSION "@KEA_SRCID@" +#define PREMIUM_EXTENDED_VERSION "@PREMIUM@" +#define PACKAGE_VERSION_TYPE "@PACKAGE_VERSION_TYPE@" diff --git a/config.h.in b/meson-config.h.in similarity index 97% rename from config.h.in rename to meson-config.h.in index 17f9a5deb9..a43b9f4035 100644 --- a/config.h.in +++ b/meson-config.h.in @@ -71,7 +71,7 @@ #mesondefine HAVE_BOTAN_BUILD_H /* Whether getsockopt(IPV6_USE_MIN_MTU) does not work */ -#mesondefine HAVE_BROKEN_GET_IPV +#mesondefine HAVE_BROKEN_GET_IPV6_USE_MIN_MTU /* Whether gtest defines edit_distance::CreateUnifiedDiff */ #mesondefine HAVE_CREATE_UNIFIED_DIFF @@ -104,7 +104,7 @@ #mesondefine HAVE_GSSAPI_GSSAPI_H /* Whether you have the header file. */ -#mesondefine HAVE_GSSAPI_GSSAPI_KRB +#mesondefine HAVE_GSSAPI_GSSAPI_KRB5_H /* gss_str_to_oid is available */ #mesondefine HAVE_GSS_STR_TO_OID @@ -116,13 +116,13 @@ #mesondefine HAVE_IS_BASE_OF /* Whether you have the header file. */ -#mesondefine HAVE_KRB +#mesondefine HAVE_KRB5_H /* Whether you have the header file. */ -#mesondefine HAVE_KRB +#mesondefine HAVE_KRB5_KRB5_H /* Whether you have the header file. */ -#mesondefine HAVE_LOG +#mesondefine HAVE_LOG4CPLUS_LOGGER_H /* MySQL is present */ #mesondefine HAVE_MYSQL @@ -191,7 +191,7 @@ #mesondefine HAVE_SYS_TYPES_H /* Whether boost::asio::ssl::context::tlsv12 is available */ -#mesondefine HAVE_TLS_ +#mesondefine HAVE_TLS_1_2_METHOD /* Whether you have the header file. */ #mesondefine HAVE_UNISTD_H @@ -212,7 +212,7 @@ #mesondefine LIBC_MUSL /* Explicit initialization of log4cplus possible */ -#mesondefine LOG +#mesondefine LOG4CPLUS_INITIALIZER_H /* Define to the sub-directory where libtool stores uninstalled libraries. */ #mesondefine LT_OBJDIR diff --git a/meson-kea_version.h.in b/meson-kea_version.h.in new file mode 100644 index 0000000000..3f5dc81bf5 --- /dev/null +++ b/meson-kea_version.h.in @@ -0,0 +1,3 @@ +#mesondefine EXTENDED_VERSION +#mesondefine PACKAGE_VERSION_TYPE +#mesondefine PREMIUM_EXTENDED_VERSION diff --git a/meson.build b/meson.build index b9798ebd0b..7089f6c9f9 100644 --- a/meson.build +++ b/meson.build @@ -1,242 +1,345 @@ -project('kea', 'cpp', version: '2.7.6-git', default_options : ['default_library=shared']) +project( + 'kea', + 'cpp', + version: '2.7.7-git', + default_options: ['default_library=shared'], +) cpp = meson.get_compiler('cpp') +project_version = meson.project_version() + +#### Imports fs = import('fs') -conf_data = configuration_data({ - # 'CHRONO_SAME_DURATION': true, - # 'CONFIG_H_WAS_INCLUDED': true, - # 'ENABLE_DEBUG': false, - # 'ENABLE_LOGGER_CHECKS': false, - 'EXTENDED_VERSION': '"@0@"'.format(meson.project_version()), - # 'FUZZING': false, - # 'FUZZING_IN_CI': false, - # 'HAS_UNDEFINED_PTHREAD_BEHAVIOR': false, - # 'HAVE_AFL': false, - # 'HAVE_BOOST_ASIO_COROUTINE_HPP': false, - # 'HAVE_BOOST_ASIO_HPP': false, - # 'HAVE_BOOST_ASIO_IP_ADDRESS_HPP': false, - # 'HAVE_BOOST_ASIO_SIGNAL_SET_HPP': false, - # 'HAVE_BOOST_ASIO_SSL_HPP': false, - # 'HAVE_BOOST_ATOMIC_HPP': false, - # 'HAVE_BOOST_CIRCULAR_BUFFER_HPP': false, - # 'HAVE_BOOST_DATE_TIME_POSIX_TIME_POSIX_TIME_TYPES_HPP': false, - # 'HAVE_BOOST_FOREACH_HPP': false, - # 'HAVE_BOOST_FUNCTIONAL_HASH_HPP': false, - # 'HAVE_BOOST_INTEGER_COMMON_FACTOR_HPP': false, - # 'HAVE_BOOST_INTERPROCESS_SYNC_INTERPROCESS_UPGRADABLE_MUTEX_HPP': false, - # 'HAVE_BOOST_SHARED_PTR_HPP': false, - # 'HAVE_BOOST_SYSTEM_ERROR_CODE_HPP': false, - # 'HAVE_BOTAN_ASIO_STREAM_H': false, - # 'HAVE_BOTAN_BUILD_H': false, - # 'HAVE_BROKEN_GET_IPV': false, - # 'HAVE_CREATE_UNIFIED_DIFF': false, - # 'HAVE_DLFCN_H': false, - # 'HAVE_EVP_MD_CTX_CREATE': false, - # 'HAVE_EVP_MD_CTX_DESTROY': false, - # 'HAVE_EVP_MD_CTX_FREE': false, - # 'HAVE_EVP_MD_CTX_NEW': false, - # 'HAVE_EVP_PKEY_NEW_MAC_KEY': false, - # 'HAVE_EVP_PKEY_NEW_RAW_PRIVATE_KEY': false, - 'HAVE_GENERIC_TLS_METHOD': true, - # 'HAVE_GSSAPI_GSSAPI_H': false, - # 'HAVE_GSSAPI_GSSAPI_KRB': false, - # 'HAVE_GSS_STR_TO_OID': false, - # 'HAVE_INTTYPES_H': false, - # 'HAVE_IS_BASE_OF': false, - # 'HAVE_KRB': false, - # 'HAVE_LOG': false, - # 'HAVE_MYSQL': false, - # 'HAVE_MYSQL_GET_OPTION': false, - # 'HAVE_MYSQL_MY_BOOL': false, - # 'HAVE_MYSQL_OPT_RECONNECT': false, - # 'HAVE_NETCONF': false, - # 'HAVE_OPTRESET': false, - # 'HAVE_PGSQL': false, - # 'HAVE_PGSQL_SSL': false, - # 'HAVE_PGSQL_TCP_USER_TIMEOUT': false, - # 'HAVE_PSELECT': false, - # 'HAVE_SA_LEN': false, - # 'HAVE_STDBOOL_H': false, - # 'HAVE_STDINT_H': false, - # 'HAVE_STDIO_H': false, - # 'HAVE_STDLIB_H': false, - # 'HAVE_STREAM_TRUNCATED_ERROR': false, - # 'HAVE_STRINGS_H': false, - # 'HAVE_STRING_H': false, - # 'HAVE_SYS_DEVPOLL_H': false, - # 'HAVE_SYS_FILIO_H': false, - # 'HAVE_SYS_STAT_H': false, - # 'HAVE_SYS_TYPES_H': false, - # 'HAVE_TLS_': false, - # 'HAVE_UNISTD_H': false, - # 'HAVE_UTILS_ERRCODES_H': false, - # 'HAVE_VALGRIND_HEADERS': false, - # 'HAVE_VALGRIND_VALGRIND_H': false, - # 'HAVE__BOOL': false, - # 'LIBC_MUSL': false, - # 'LOG': false, - # 'LT_OBJDIR': false, - # 'OS_BSD': false, - # 'OS_FREEBSD': false, - # 'OS_LINUX': false, - # 'OS_NETBSD': false, - # 'OS_OPENBSD': false, - # 'OS_OSX': false, - # 'OS_SOLARIS': false, - # 'PACKAGE': 'kea', - # 'PACKAGE_BUGREPORT': 'kea-dev@lists.isc.org', - # 'PACKAGE_NAME': 'kea', - # 'PACKAGE_STRING': 'kea @0@'.format(meson.project_version()), - # 'PACKAGE_TARNAME': 'kea', - # 'PACKAGE_URL': '', - # 'PACKAGE_VERSION': meson.project_version(), - 'PACKAGE_VERSION_TYPE': '"tarball"', - # 'PREMIUM': false, - 'PREMIUM_EXTENDED_VERSION': '"@0@"'.format(meson.project_version()), - # 'STDC_HEADERS': false, - # 'TOP_BUILDDIR': false, - # 'USE_STATIC_LINK': false, - 'VERSION': '"@0@"'.format(meson.project_version()), - # 'WITH_BOTAN': false, - # 'WITH_HEIMDAL': false, - # 'WITH_OPENSSL': false, - # 'YYTEXT_POINTER': false, - # 'SIZE_T': 'size_t', - # 'SSIZE_T': 'ssize_t', -}) +#### Variables + +TOP_BUILD_DIR = meson.current_build_dir() +TOP_SOURCE_DIR = meson.current_source_dir() +KEA_ADMIN = f'@TOP_BUILD_DIR@/src/bin/admin/kea-admin' +KEA_LFC = f'@TOP_BUILD_DIR@/src/bin/lfc/kea-lfc' + +#### Configuration Data + +conf_data = configuration_data( + { + # 'CONFIG_H_WAS_INCLUDED': true, + # 'ENABLE_DEBUG': false, + # 'ENABLE_LOGGER_CHECKS': false, + 'EXTENDED_VERSION': f'"@project_version@"', + # 'FUZZING': false, + # 'FUZZING_IN_CI': false, + # 'HAS_UNDEFINED_PTHREAD_BEHAVIOR': false, + # 'HAVE_AFL': false, + # 'HAVE_BOOST_ASIO_COROUTINE_HPP': false, + # 'HAVE_BOOST_ASIO_HPP': false, + # 'HAVE_BOOST_ASIO_IP_ADDRESS_HPP': false, + # 'HAVE_BOOST_ASIO_SIGNAL_SET_HPP': false, + # 'HAVE_BOOST_ASIO_SSL_HPP': false, + # 'HAVE_BOOST_ATOMIC_HPP': false, + # 'HAVE_BOOST_CIRCULAR_BUFFER_HPP': false, + # 'HAVE_BOOST_DATE_TIME_POSIX_TIME_POSIX_TIME_TYPES_HPP': false, + # 'HAVE_BOOST_FOREACH_HPP': false, + # 'HAVE_BOOST_FUNCTIONAL_HASH_HPP': false, + # 'HAVE_BOOST_INTEGER_COMMON_FACTOR_HPP': false, + # 'HAVE_BOOST_INTERPROCESS_SYNC_INTERPROCESS_UPGRADABLE_MUTEX_HPP': false, + # 'HAVE_BOOST_SHARED_PTR_HPP': false, + # 'HAVE_BOOST_SYSTEM_ERROR_CODE_HPP': false, + # 'HAVE_BOTAN_ASIO_STREAM_H': false, + # 'HAVE_BOTAN_BUILD_H': false, + # 'HAVE_BROKEN_GET_IPV': false, + # 'HAVE_CREATE_UNIFIED_DIFF': false, + # 'HAVE_DLFCN_H': false, + # 'HAVE_EVP_MD_CTX_CREATE': false, + # 'HAVE_EVP_MD_CTX_DESTROY': false, + # 'HAVE_EVP_MD_CTX_FREE': false, + # 'HAVE_EVP_MD_CTX_NEW': false, + # 'HAVE_EVP_PKEY_NEW_MAC_KEY': false, + # 'HAVE_EVP_PKEY_NEW_RAW_PRIVATE_KEY': false, + # 'HAVE_GSSAPI_GSSAPI_H': false, + # 'HAVE_GSSAPI_GSSAPI_KRB': false, + # 'HAVE_GSS_STR_TO_OID': false, + # 'HAVE_INTTYPES_H': false, + # 'HAVE_IS_BASE_OF': false, + # 'HAVE_KRB': false, + # '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, + # 'HAVE_PSELECT': false, + # 'HAVE_STDBOOL_H': false, + # 'HAVE_STDINT_H': false, + # 'HAVE_STDIO_H': false, + # 'HAVE_STDLIB_H': false, + # 'HAVE_STRINGS_H': false, + # 'HAVE_STRING_H': false, + # 'HAVE_SYS_DEVPOLL_H': false, + # 'HAVE_SYS_FILIO_H': false, + # 'HAVE_SYS_STAT_H': false, + # 'HAVE_SYS_TYPES_H': false, + # 'HAVE_TLS_': false, + # 'HAVE_UNISTD_H': false, + # 'HAVE_UTILS_ERRCODES_H': false, + # 'HAVE_VALGRIND_HEADERS': false, + # 'HAVE_VALGRIND_VALGRIND_H': false, + # 'HAVE__BOOL': false, + # 'LIBC_MUSL': false, + # 'LOG': false, + # 'LT_OBJDIR': false, + # 'PACKAGE': 'kea', + # 'PACKAGE_BUGREPORT': 'kea-dev@lists.isc.org', + # 'PACKAGE_NAME': 'kea', + # 'PACKAGE_STRING': f'kea "@project_version@"', + # 'PACKAGE_TARNAME': 'kea', + # 'PACKAGE_URL': '', + # 'PACKAGE_VERSION': meson.project_version(), + 'PACKAGE_VERSION_TYPE': '"tarball"', + # 'PREMIUM': false, + 'PREMIUM_EXTENDED_VERSION': f'"@project_version@"', + # 'STDC_HEADERS': false, + # 'TOP_BUILDDIR': false, + # 'USE_STATIC_LINK': false, + 'VERSION': f'"@project_version@"', + # 'WITH_HEIMDAL': false, + # 'YYTEXT_POINTER': false, + # 'SIZE_T': 'size_t', + # 'SSIZE_T': 'ssize_t', + }, +) + +#### Dependencies boost = dependency('boost', version: '>=1.66') -botan = dependency('botan', required: false) gtest = dependency('gtest', required: false) log4cplus = dependency('log4cplus') + +# Cryptography +crypto = disabler() +botan = disabler() +foreach dep : ['botan-2', 'botan', 'botan-3'] + botan = dependency(dep, required: false) + if botan.found() + break + endif +endforeach +openssl = dependency('openssl', required: false) +if botan.found() and false # remove "or flase" when botan+mariadb gets fixes + crypto = botan + conf_data.set('WITH_BOTAN', true) + message('Using Botan.') +elif openssl.found() + crypto = openssl + conf_data.set('WITH_OPENSSL', true) + message('Using OpenSSL.') +endif +if not crypto.found() + error('Build failed: Could not find neither botan nor openssl libraries.') +endif + +# Kerberos krb5 = dependency('krb5', required: false) +if not krb5.found() + krb5_config = find_program('krb5-config', required: false) + cflags = run_command([krb5_config, '--cflags'], check: false) + libs = run_command([krb5_config, '--libs'], check: false) + if cflags.returncode() == 0 and libs.returncode() == 0 + krb5 = declare_dependency( + compile_args: cflags.stdout().split(), + link_args: libs.stdout().split(), + ) + endif +endif + +# MySQL mysql = dependency('mariadb', required: false) if not mysql.found() - mysql = dependency('mysql', required: false) + mysql = dependency('mysql', required: false) endif -if not mysql.found() - mysql_config = find_program('mariadb_config', required: false) - if mysql_config.found() - mysql = declare_dependency(compile_args: run_command([mysql_config, '--cflags']).stdout().split(), - link_args: run_command([mysql_config, '--libs']).stdout().split()) - endif +foreach mysql_config : ['mariadb_config', 'mysql_config'] + if mysql.found() + continue + endif + mysql_config = find_program(mysql_config, 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) + if cflags.returncode() == 0 and libs.returncode() == 0 + mysql = declare_dependency( + compile_args: cflags.stdout().split(), + link_args: libs.stdout().split(), + ) + break + endif +endforeach +if mysql.found() + conf_data.set('HAVE_MYSQL', true) endif -if not mysql.found() - mysql_config = find_program('mysql_config') - if mysql_config.found() - mysql = declare_dependency(compile_args: run_command([mysql_config, '--cflags']).stdout().split(), - link_args: run_command([mysql_config, '--libs']).stdout().split()) - endif -endif -postgresql = dependency('libpq', required: false) -openssl = dependency('openssl', required: false) +# PostgreSQL +postgresql = dependency('libpq', required: false) +if not postgresql.found() + pg_config = find_program('pg_config', required: false) + cflags = run_command([pg_config, '--cflags'], check: false) + libs = run_command([pg_config, '--libs'], check: false) + if cflags.returncode() == 0 and libs.returncode() == 0 + krb5 = declare_dependency( + compile_args: cflags.stdout().split(), + link_args: libs.stdout().split(), + ) + endif +endif +postgresql_server_header = disabler() +foreach dir : ['/usr/include/pgsql/server', '/usr/include/postgresql/server'] + if not fs.is_dir(dir) + continue + endif + exists = cpp.has_header( + 'utils/errcodes.h', + include_directories: [include_directories(dir)], + required: false, + ) + if exists + postgresql_server_header = declare_dependency(include_directories: dir) + break + endif +endforeach +if postgresql.found() + conf_data.set('HAVE_PGSQL', true) +endif + +# NETCONF netconf_deps = {} netconf_deps_array = [] netconf_deps_found = true foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp'] - netconf_deps = netconf_deps + {dep: cpp.find_library(dep, dirs: [f'/opt/@dep@/lib'], required: false)} - if netconf_deps[dep].found() - netconf_deps = netconf_deps + {dep: declare_dependency( - dependencies: netconf_deps[dep], - include_directories: include_directories(f'/opt/@dep@/include'), - )} - netconf_deps_array += netconf_deps[dep] - else - netconf_deps_found = false - break - endif + netconf_deps = netconf_deps + {dep: dependency(dep, required: false)} + if not netconf_deps[dep].found() + lib = cpp.find_library(dep, dirs: [f'/opt/@dep@/lib'], required: false) + if lib.found() + netconf_deps = netconf_deps + { + dep: declare_dependency( + dependencies: lib, + include_directories: include_directories( + f'/opt/@dep@/include', + ), + ), + } + endif + endif + if netconf_deps[dep].found() + netconf_deps_array += netconf_deps[dep] + else + netconf_deps_found = false + endif endforeach -if netconf_deps_found - add_project_arguments('-std=c++20', language: 'cpp') -endif -if openssl.found() - crypto = openssl - conf_data.set('WITH_OPENSSL', true) - message('Using OpenSSL.') -elif botan.found() - crypto = botan - conf_data.set('WITH_BOTAN', true) - message('Using Botan.') -else - error('Build failed: Could not find neither botan nor openssl libraries.') -endif +#### Compiler Checks -result = cpp.run(fs.read('compiler-checks/stream-truncated-error.cc'), name: 'HAVE_STREAM_TRUNCATED_ERROR', dependencies: [crypto]) -if result.compiled() and result.returncode() == 0 - conf_data.set('HAVE_STREAM_TRUNCATED_ERROR', true) -endif +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) + +result = cpp.run( + fs.read('compiler-checks/have-generic-tls-method.cc'), + name: 'HAVE_GENERIC_TLS_METHOD', + dependencies: [crypto], +) +conf_data.set('HAVE_GENERIC_TLS_METHOD', result.returncode() == 0) + +result = cpp.run(fs.read('compiler-checks/have-sa-len.cc'), name: 'HAVE_SA_LEN') +conf_data.set('HAVE_SA_LEN', result.returncode() == 0) if mysql.found() - result = cpp.run(fs.read('compiler-checks/mysql-my-bool.cc'), name: 'HAVE_MYSQL_MY_BOOL', dependencies: [mysql]) - if result.compiled() and result.returncode() == 0 - conf_data.set('HAVE_MYSQL_MY_BOOL', true) - endif + result = cpp.run( + fs.read('compiler-checks/mysql-my-bool.cc'), + name: 'HAVE_MYSQL_MY_BOOL', + dependencies: [mysql], + ) + conf_data.set('HAVE_MYSQL_MY_BOOL', result.returncode() == 0) endif -system = build_machine.system() -if system == 'linux' - conf_data.set('OS_LINUX', true) -elif system == 'freebsd' - conf_data.set('OS_BSD', true) - conf_data.set('OS_FREEBSD', true) - conf_data.set('HAVE_SA_LEN', true) -elif system == 'netbsd' - conf_data.set('OS_BSD', true) - conf_data.set('OS_NETBSD', true) - conf_data.set('HAVE_SA_LEN', true) -elif system == 'openbsd' - conf_data.set('OS_BSD', true) - conf_data.set('OS_OPENBSD', true) - conf_data.set('HAVE_SA_LEN', true) -elif system == 'sun' - conf_data.set('OS_SOLARIS', true) -elif system == 'darwin' - conf_data.set('OS_BSD', true) - conf_data.set('OS_OSX', true) - conf_data.set('HAVE_SA_LEN', true) +result = cpp.run( + fs.read('compiler-checks/stream-truncated-error.cc'), + name: 'HAVE_STREAM_TRUNCATED_ERROR', + dependencies: [crypto], +) +conf_data.set('HAVE_STREAM_TRUNCATED_ERROR', result.returncode() == 0) + +#### System-specific Variables + +SYSTEM = build_machine.system() +if SYSTEM == 'linux' + conf_data.set('OS_LINUX', true) +elif SYSTEM == 'freebsd' + conf_data.set('OS_BSD', true) + conf_data.set('OS_FREEBSD', true) +elif SYSTEM == 'netbsd' + conf_data.set('OS_BSD', true) + conf_data.set('OS_NETBSD', true) +elif SYSTEM == 'openbsd' + conf_data.set('OS_BSD', true) + conf_data.set('OS_OPENBSD', true) +elif SYSTEM == 'sun' + conf_data.set('OS_SOLARIS', true) +elif SYSTEM == 'darwin' + conf_data.set('OS_BSD', true) + conf_data.set('OS_OSX', true) else - error(f'Build failed: Unsupported system "@system@".') + error(f'Build failed: Unsupported system "@SYSTEM@".') endif -message(f'Detected system "@system@".') +message(f'Detected system "@SYSTEM@".') + +#### System-specific Compiler Flags prefix = get_option('prefix') -if system == 'darwin' - add_project_arguments('-D__APPLE_USE_RFC_3542', language: 'cpp') - add_project_link_arguments(f'-Wl,-rpath,@prefix@/lib', language: 'cpp') +if SYSTEM == 'darwin' + add_project_arguments('-D__APPLE_USE_RFC_3542', language: 'cpp') + add_project_link_arguments(f'-Wl,-rpath,@prefix@/lib', language: 'cpp') else - conf_data.set('CHRONO_SAME_DURATION', true) - add_project_link_arguments(f'-Wl,-rpath=@prefix@/lib', language: 'cpp') + add_project_link_arguments(f'-Wl,-rpath=@prefix@/lib', language: 'cpp') endif -have_premium = false -if fs.is_dir('premium') - have_premium = true - conf_data.set('PREMIUM', true) +have_premium = fs.is_dir('premium') +if have_premium + conf_data.set('PREMIUM', true) endif -configure_file(input : 'config.h.in', - output : 'config.h', - configuration : conf_data) +#### Configuration Files -configure_file(input : 'kea_version.h.in', - output : 'kea_version.h', - configuration : conf_data) +# TODO: Change to config.h.in when autotools are removed. +configure_file( + input: 'meson-config.h.in', + output: 'config.h', + configuration: conf_data, +) -includes = [ - include_directories('.'), - include_directories('src/bin'), - include_directories('src/lib'), +# TODO: Change to kea_version.h.in when autotools are removed. +configure_file( + input: 'meson-kea_version.h.in', + output: 'kea_version.h', + configuration: conf_data, +) + +#### Default Includes + +INCLUDES = [ + include_directories('.'), + include_directories('src/bin'), + include_directories('src/lib'), ] -kea_admin = '@0@/src/bin/admin/kea-admin'.format(meson.current_build_dir()) -kea_lfc = '@0@/src/bin/lfc/kea-lfc'.format(meson.current_build_dir()) +#### Build Starts Here -libs_built_so_far = [] +LIBS_BUILT_SO_FAR = [] subdir('src') if have_premium - subdir('premium') + subdir('premium') endif diff --git a/src/bin/dhcp4/meson.build b/src/bin/dhcp4/meson.build index 2e9c55453a..3dc437661f 100644 --- a/src/bin/dhcp4/meson.build +++ b/src/bin/dhcp4/meson.build @@ -1,22 +1,25 @@ -dhcp4_lib = static_library('dhcp4', - 'client_handler.cc', - 'ctrl_dhcp4_srv.cc', - 'dhcp4to6_ipc.cc', - 'dhcp4_lexer.cc', - 'dhcp4_log.cc', - 'dhcp4_messages.cc', - 'dhcp4_parser.cc', - 'dhcp4_srv.cc', - 'json_config_parser.cc', - 'parser_context.cc', - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far, +dhcp4_lib = static_library( + 'dhcp4', + 'client_handler.cc', + 'ctrl_dhcp4_srv.cc', + 'dhcp4to6_ipc.cc', + 'dhcp4_lexer.cc', + 'dhcp4_log.cc', + 'dhcp4_messages.cc', + 'dhcp4_parser.cc', + 'dhcp4_srv.cc', + 'json_config_parser.cc', + 'parser_context.cc', + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR, ) -kea_dhcp4_exe = executable('kea-dhcp4', - 'main.cc', - dependencies: [crypto], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'sbin', - link_with: libs_built_so_far + [dhcp4_lib], +executable( + 'kea-dhcp4', + 'main.cc', + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'sbin', + link_with: LIBS_BUILT_SO_FAR + [dhcp4_lib], ) diff --git a/src/bin/dhcp6/meson.build b/src/bin/dhcp6/meson.build index ce4e9a87c9..146eb9765e 100644 --- a/src/bin/dhcp6/meson.build +++ b/src/bin/dhcp6/meson.build @@ -1,32 +1,36 @@ -dhcp6_lib = static_library('dhcp6', - 'client_handler.cc', - 'client_handler.h', - 'ctrl_dhcp6_srv.cc', - 'ctrl_dhcp6_srv.h', - 'dhcp6to4_ipc.cc', - 'dhcp6to4_ipc.h', - 'dhcp6_lexer.cc', - 'dhcp6_log.cc', - 'dhcp6_log.h', - 'dhcp6_messages.cc', - 'dhcp6_messages.h', - 'dhcp6_parser.cc', - 'dhcp6_parser.h', - 'dhcp6_srv.cc', - 'dhcp6_srv.h', - 'json_config_parser.cc', - 'json_config_parser.h', - 'main.cc', - 'parser_context.cc', - 'parser_context.h', - 'parser_context_decl.h', - include_directories: includes +dhcp6_lib = static_library( + 'dhcp6', + 'client_handler.cc', + 'client_handler.h', + 'ctrl_dhcp6_srv.cc', + 'ctrl_dhcp6_srv.h', + 'dhcp6to4_ipc.cc', + 'dhcp6to4_ipc.h', + 'dhcp6_lexer.cc', + 'dhcp6_log.cc', + 'dhcp6_log.h', + 'dhcp6_messages.cc', + 'dhcp6_messages.h', + 'dhcp6_parser.cc', + 'dhcp6_parser.h', + 'dhcp6_srv.cc', + 'dhcp6_srv.h', + 'json_config_parser.cc', + 'json_config_parser.h', + 'main.cc', + 'parser_context.cc', + 'parser_context.h', + 'parser_context_decl.h', + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR, ) -kea_dhcp6_exe = executable('kea-dhcp6', - 'main.cc', - dependencies: [crypto], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'sbin', - link_with: libs_built_so_far + [dhcp6_lib], +executable( + 'kea-dhcp6', + 'main.cc', + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'sbin', + link_with: LIBS_BUILT_SO_FAR + [dhcp6_lib], ) diff --git a/src/bin/lfc/meson.build b/src/bin/lfc/meson.build index 870a0da2ba..f8bb3160ad 100644 --- a/src/bin/lfc/meson.build +++ b/src/bin/lfc/meson.build @@ -1,17 +1,19 @@ -lfc_lib = static_library('lfc', - 'lfc_controller.cc', - 'lfc_controller.h', - 'lfc_log.cc', - 'lfc_log.h', - 'lfc_messages.cc', - 'lfc_messages.h', - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far, +lfc_lib = static_library( + 'lfc', + 'lfc_controller.cc', + 'lfc_controller.h', + 'lfc_log.cc', + 'lfc_log.h', + 'lfc_messages.cc', + 'lfc_messages.h', + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR, ) -kea_lfc_exe = executable('kea-lfc', - 'main.cc', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'sbin', - link_with: libs_built_so_far + [lfc_lib], +executable( + 'kea-lfc', + 'main.cc', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'sbin', + link_with: LIBS_BUILT_SO_FAR + [lfc_lib], ) diff --git a/src/bin/perfdhcp/meson.build b/src/bin/perfdhcp/meson.build index 74cc31269f..fa73e45f16 100644 --- a/src/bin/perfdhcp/meson.build +++ b/src/bin/perfdhcp/meson.build @@ -1,36 +1,38 @@ -perfdhcplib_lib = static_library('perfdhcplib', - 'abstract_scen.h', - 'avalanche_scen.cc', - 'avalanche_scen.h', - 'basic_scen.cc', - 'basic_scen.h', - 'command_options.cc', - 'command_options.h', - 'localized_option.h', - 'packet_storage.h', - 'perf_pkt4.cc', - 'perf_pkt4.h', - 'perf_pkt6.cc', - 'perf_pkt6.h', - 'perf_socket.cc', - 'perf_socket.h', - 'pkt_transform.cc', - 'pkt_transform.h', - 'rate_control.cc', - 'rate_control.h', - 'receiver.cc', - 'receiver.h', - 'stats_mgr.cc', - 'stats_mgr.h', - 'test_control.cc', - 'test_control.h', - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far, +perfdhcplib_lib = static_library( + 'perfdhcplib', + 'abstract_scen.h', + 'avalanche_scen.cc', + 'avalanche_scen.h', + 'basic_scen.cc', + 'basic_scen.h', + 'command_options.cc', + 'command_options.h', + 'localized_option.h', + 'packet_storage.h', + 'perf_pkt4.cc', + 'perf_pkt4.h', + 'perf_pkt6.cc', + 'perf_pkt6.h', + 'perf_socket.cc', + 'perf_socket.h', + 'pkt_transform.cc', + 'pkt_transform.h', + 'rate_control.cc', + 'rate_control.h', + 'receiver.cc', + 'receiver.h', + 'stats_mgr.cc', + 'stats_mgr.h', + 'test_control.cc', + 'test_control.h', + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR, ) -perfdhcp_exe = executable('perfdhcp', - 'main.cc', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'sbin', - link_with: libs_built_so_far + [perfdhcplib_lib], +executable( + 'perfdhcp', + 'main.cc', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'sbin', + link_with: LIBS_BUILT_SO_FAR + [perfdhcplib_lib], ) diff --git a/src/hooks/dhcp/bootp/meson.build b/src/hooks/dhcp/bootp/meson.build index 88fa697a29..efcd23effa 100644 --- a/src/hooks/dhcp/bootp/meson.build +++ b/src/hooks/dhcp/bootp/meson.build @@ -1,12 +1,13 @@ -dhcp_bootp_lib = library('dhcp_bootp', - 'bootp_callouts.cc', - 'bootp_log.cc', - 'bootp_log.h', - 'bootp_messages.cc', - 'bootp_messages.h', - 'version.cc', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib/kea/hooks', - link_with: libs_built_so_far, +dhcp_bootp_lib = library( + 'dhcp_bootp', + 'bootp_callouts.cc', + 'bootp_log.cc', + 'bootp_log.h', + 'bootp_messages.cc', + 'bootp_messages.h', + 'version.cc', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib/kea/hooks', + 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 a7753d0b20..881a163f53 100644 --- a/src/hooks/dhcp/flex_option/meson.build +++ b/src/hooks/dhcp/flex_option/meson.build @@ -1,14 +1,16 @@ -dhcp_flex_option_lib = library('dhcp_flex_option', - 'flex_option.cc', - 'flex_option.h', - 'flex_option_callouts.cc', - 'flex_option_log.cc', - 'flex_option_log.h', - 'flex_option_messages.cc', - 'flex_option_messages.h', - 'version.cc', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib/kea/hooks', - link_with: libs_built_so_far, +dhcp_flex_option_lib = library( + 'dhcp_flex_option', + 'flex_option.cc', + 'flex_option.h', + 'flex_option_callouts.cc', + 'flex_option_log.cc', + 'flex_option_log.h', + 'flex_option_messages.cc', + 'flex_option_messages.h', + 'version.cc', + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib/kea/hooks', + 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 cbbd345c89..99730a78d8 100644 --- a/src/hooks/dhcp/high_availability/meson.build +++ b/src/hooks/dhcp/high_availability/meson.build @@ -1,35 +1,36 @@ -dhcp_high_availability_lib = library('dhcp_high_availability', - 'command_creator.cc', - 'command_creator.h', - 'communication_state.cc', - 'communication_state.h', - 'ha_callouts.cc', - 'ha_config.cc', - 'ha_config.h', - 'ha_config_parser.cc', - 'ha_config_parser.h', - 'ha_impl.cc', - 'ha_impl.h', - 'ha_log.cc', - 'ha_log.h', - 'ha_messages.cc', - 'ha_messages.h', - 'ha_relationship_mapper.h', - 'ha_server_type.h', - 'ha_service.cc', - 'ha_service.h', - 'ha_service_states.cc', - 'ha_service_states.h', - 'lease_sync_filter.cc', - 'lease_sync_filter.h', - 'lease_update_backlog.cc', - 'lease_update_backlog.h', - 'query_filter.cc', - 'query_filter.h', - 'version.cc', - dependencies: [crypto], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib/kea/hooks', - link_with: libs_built_so_far, +dhcp_high_availability_lib = library( + 'dhcp_high_availability', + 'command_creator.cc', + 'command_creator.h', + 'communication_state.cc', + 'communication_state.h', + 'ha_callouts.cc', + 'ha_config.cc', + 'ha_config.h', + 'ha_config_parser.cc', + 'ha_config_parser.h', + 'ha_impl.cc', + 'ha_impl.h', + 'ha_log.cc', + 'ha_log.h', + 'ha_messages.cc', + 'ha_messages.h', + 'ha_relationship_mapper.h', + 'ha_server_type.h', + 'ha_service.cc', + 'ha_service.h', + 'ha_service_states.cc', + 'ha_service_states.h', + 'lease_sync_filter.cc', + 'lease_sync_filter.h', + 'lease_update_backlog.cc', + 'lease_update_backlog.h', + 'query_filter.cc', + 'query_filter.h', + 'version.cc', + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib/kea/hooks', + 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 90160399f2..e686d8963b 100644 --- a/src/hooks/dhcp/lease_cmds/meson.build +++ b/src/hooks/dhcp/lease_cmds/meson.build @@ -1,17 +1,19 @@ -dhcp_lease_cmds_lib = library('dhcp_lease_cmds', - 'lease_cmds.cc', - 'lease_cmds.h', - 'lease_cmds_callouts.cc', - 'lease_cmds_exceptions.h', - 'lease_cmds_log.cc', - 'lease_cmds_log.h', - 'lease_cmds_messages.cc', - 'lease_cmds_messages.h', - 'lease_parser.cc', - 'lease_parser.h', - 'version.cc', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib/kea/hooks', - link_with: libs_built_so_far, +dhcp_lease_cmds_lib = library( + 'dhcp_lease_cmds', + 'lease_cmds.cc', + 'lease_cmds.h', + 'lease_cmds_callouts.cc', + 'lease_cmds_exceptions.h', + 'lease_cmds_log.cc', + 'lease_cmds_log.h', + 'lease_cmds_messages.cc', + 'lease_cmds_messages.h', + 'lease_parser.cc', + 'lease_parser.h', + 'version.cc', + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib/kea/hooks', + link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/mysql/meson.build b/src/hooks/dhcp/mysql/meson.build index ae0616b6bb..63a6581f6b 100644 --- a/src/hooks/dhcp/mysql/meson.build +++ b/src/hooks/dhcp/mysql/meson.build @@ -1,36 +1,37 @@ if not mysql.found() - subdir_done() + subdir_done() endif -dhcp_mysql_lib = library('dhcp_mysql', - 'mysql_callouts.cc', - 'mysql_cb_dhcp4.cc', - 'mysql_cb_dhcp4.h', - 'mysql_cb_dhcp6.cc', - 'mysql_cb_dhcp6.h', - 'mysql_cb_impl.cc', - 'mysql_cb_impl.h', - 'mysql_cb_log.cc', - 'mysql_cb_log.h', - 'mysql_cb_messages.cc', - 'mysql_cb_messages.h', - 'mysql_hb_log.cc', - 'mysql_hb_log.h', - 'mysql_hb_messages.cc', - 'mysql_hb_messages.h', - 'mysql_host_data_source.cc', - 'mysql_host_data_source.h', - 'mysql_lb_log.cc', - 'mysql_lb_log.h', - 'mysql_lb_messages.cc', - 'mysql_lb_messages.h', - 'mysql_lease_mgr.cc', - 'mysql_lease_mgr.h', - 'mysql_query_macros_dhcp.h', - 'version.cc', - dependencies: [mysql], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib/kea/hooks', - link_with: libs_built_so_far, +dhcp_mysql_lib = library( + 'dhcp_mysql', + 'mysql_callouts.cc', + 'mysql_cb_dhcp4.cc', + 'mysql_cb_dhcp4.h', + 'mysql_cb_dhcp6.cc', + 'mysql_cb_dhcp6.h', + 'mysql_cb_impl.cc', + 'mysql_cb_impl.h', + 'mysql_cb_log.cc', + 'mysql_cb_log.h', + 'mysql_cb_messages.cc', + 'mysql_cb_messages.h', + 'mysql_hb_log.cc', + 'mysql_hb_log.h', + 'mysql_hb_messages.cc', + 'mysql_hb_messages.h', + 'mysql_host_data_source.cc', + 'mysql_host_data_source.h', + 'mysql_lb_log.cc', + 'mysql_lb_log.h', + 'mysql_lb_messages.cc', + 'mysql_lb_messages.h', + 'mysql_lease_mgr.cc', + 'mysql_lease_mgr.h', + 'mysql_query_macros_dhcp.h', + 'version.cc', + dependencies: [crypto, mysql], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib/kea/hooks', + link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/perfmon/meson.build b/src/hooks/dhcp/perfmon/meson.build index c203a82c77..180afeb952 100644 --- a/src/hooks/dhcp/perfmon/meson.build +++ b/src/hooks/dhcp/perfmon/meson.build @@ -1,24 +1,26 @@ -dhcp_perfmon_lib = library('dhcp_perfmon', - 'alarm.cc', - 'alarm.h', - 'alarm_store.cc', - 'alarm_store.h', - 'monitored_duration.cc', - 'monitored_duration.h', - 'monitored_duration_store.cc', - 'monitored_duration_store.h', - 'perfmon_callouts.cc', - 'perfmon_config.cc', - 'perfmon_config.h', - 'perfmon_log.cc', - 'perfmon_log.h', - 'perfmon_messages.cc', - 'perfmon_messages.h', - 'perfmon_mgr.cc', - 'perfmon_mgr.h', - 'version.cc', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib/kea/hooks', - link_with: libs_built_so_far, +dhcp_perfmon_lib = library( + 'dhcp_perfmon', + 'alarm.cc', + 'alarm.h', + 'alarm_store.cc', + 'alarm_store.h', + 'monitored_duration.cc', + 'monitored_duration.h', + 'monitored_duration_store.cc', + 'monitored_duration_store.h', + 'perfmon_callouts.cc', + 'perfmon_config.cc', + 'perfmon_config.h', + 'perfmon_log.cc', + 'perfmon_log.h', + 'perfmon_messages.cc', + 'perfmon_messages.h', + 'perfmon_mgr.cc', + 'perfmon_mgr.h', + 'version.cc', + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib/kea/hooks', + link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/pgsql/meson.build b/src/hooks/dhcp/pgsql/meson.build index 99297a23eb..6c5cc25904 100644 --- a/src/hooks/dhcp/pgsql/meson.build +++ b/src/hooks/dhcp/pgsql/meson.build @@ -1,36 +1,37 @@ -if not postgresql.found() - subdir_done() +if not postgresql.found() or not postgresql_server_header.found() + subdir_done() endif -dhcp_pgsql_lib = library('dhcp_pgsql', - 'pgsql_callouts.cc', - 'pgsql_cb_dhcp4.cc', - 'pgsql_cb_dhcp4.h', - 'pgsql_cb_dhcp6.cc', - 'pgsql_cb_dhcp6.h', - 'pgsql_cb_impl.cc', - 'pgsql_cb_impl.h', - 'pgsql_cb_log.cc', - 'pgsql_cb_log.h', - 'pgsql_cb_messages.cc', - 'pgsql_cb_messages.h', - 'pgsql_hb_log.cc', - 'pgsql_hb_log.h', - 'pgsql_hb_messages.cc', - 'pgsql_hb_messages.h', - 'pgsql_host_data_source.cc', - 'pgsql_host_data_source.h', - 'pgsql_lb_log.cc', - 'pgsql_lb_log.h', - 'pgsql_lb_messages.cc', - 'pgsql_lb_messages.h', - 'pgsql_lease_mgr.cc', - 'pgsql_lease_mgr.h', - 'pgsql_query_macros_dhcp.h', - 'version.cc', - dependencies: [postgresql], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib/kea/hooks', - link_with: libs_built_so_far, +dhcp_pgsql_lib = library( + 'dhcp_pgsql', + 'pgsql_callouts.cc', + 'pgsql_cb_dhcp4.cc', + 'pgsql_cb_dhcp4.h', + 'pgsql_cb_dhcp6.cc', + 'pgsql_cb_dhcp6.h', + 'pgsql_cb_impl.cc', + 'pgsql_cb_impl.h', + 'pgsql_cb_log.cc', + 'pgsql_cb_log.h', + 'pgsql_cb_messages.cc', + 'pgsql_cb_messages.h', + 'pgsql_hb_log.cc', + 'pgsql_hb_log.h', + 'pgsql_hb_messages.cc', + 'pgsql_hb_messages.h', + 'pgsql_host_data_source.cc', + 'pgsql_host_data_source.h', + 'pgsql_lb_log.cc', + 'pgsql_lb_log.h', + 'pgsql_lb_messages.cc', + 'pgsql_lb_messages.h', + 'pgsql_lease_mgr.cc', + 'pgsql_lease_mgr.h', + 'pgsql_query_macros_dhcp.h', + 'version.cc', + dependencies: [crypto, postgresql], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib/kea/hooks', + 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 e98c01ed07..36575ca96c 100644 --- a/src/hooks/dhcp/run_script/meson.build +++ b/src/hooks/dhcp/run_script/meson.build @@ -1,14 +1,16 @@ -dhcp_run_script_lib = library('dhcp_run_script', - 'run_script.cc', - 'run_script.h', - 'run_script_callouts.cc', - 'run_script_log.cc', - 'run_script_log.h', - 'run_script_messages.cc', - 'run_script_messages.h', - 'version.cc', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib/kea/hooks', - link_with: libs_built_so_far, +dhcp_run_script_lib = library( + 'dhcp_run_script', + 'run_script.cc', + 'run_script.h', + 'run_script_callouts.cc', + 'run_script_log.cc', + 'run_script_log.h', + 'run_script_messages.cc', + 'run_script_messages.h', + 'version.cc', + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib/kea/hooks', + 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 68f92b911f..1b1aa75c44 100644 --- a/src/hooks/dhcp/stat_cmds/meson.build +++ b/src/hooks/dhcp/stat_cmds/meson.build @@ -1,14 +1,16 @@ -dhcp_stat_cmds_lib = library('dhcp_stat_cmds', - 'stat_cmds.cc', - 'stat_cmds.h', - 'stat_cmds_callouts.cc', - 'stat_cmds_log.cc', - 'stat_cmds_log.h', - 'stat_cmds_messages.cc', - 'stat_cmds_messages.h', - 'version.cc', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib/kea/hooks', - link_with: libs_built_so_far, +dhcp_stat_cmds_lib = library( + 'dhcp_stat_cmds', + 'stat_cmds.cc', + 'stat_cmds.h', + 'stat_cmds_callouts.cc', + 'stat_cmds_log.cc', + 'stat_cmds_log.h', + 'stat_cmds_messages.cc', + 'stat_cmds_messages.h', + 'version.cc', + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib/kea/hooks', + link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/hooks/dhcp/user_chk/meson.build b/src/hooks/dhcp/user_chk/meson.build index c842cbee71..373d5cf851 100644 --- a/src/hooks/dhcp/user_chk/meson.build +++ b/src/hooks/dhcp/user_chk/meson.build @@ -1,23 +1,24 @@ -dhcp_user_chk_lib = library('dhcp_user_chk', - 'load_unload.cc', - 'pkt_receive_co.cc', - 'pkt_send_co.cc', - 'subnet_select_co.cc', - 'user.cc', - 'user.h', - 'user_chk.h', - 'user_chk_log.cc', - 'user_chk_log.h', - 'user_chk_messages.cc', - 'user_chk_messages.h', - 'user_data_source.h', - 'user_file.cc', - 'user_file.h', - 'user_registry.cc', - 'user_registry.h', - 'version.cc', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib/kea/hooks', - link_with: libs_built_so_far, +dhcp_user_chk_lib = library( + 'dhcp_user_chk', + 'load_unload.cc', + 'pkt_receive_co.cc', + 'pkt_send_co.cc', + 'subnet_select_co.cc', + 'user.cc', + 'user.h', + 'user_chk.h', + 'user_chk_log.cc', + 'user_chk_log.h', + 'user_chk_messages.cc', + 'user_chk_messages.h', + 'user_data_source.h', + 'user_file.cc', + 'user_file.h', + 'user_registry.cc', + 'user_registry.h', + 'version.cc', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib/kea/hooks', + link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/asiodns/meson.build b/src/lib/asiodns/meson.build index 7061166fcf..fa08da6eed 100644 --- a/src/lib/asiodns/meson.build +++ b/src/lib/asiodns/meson.build @@ -1,14 +1,15 @@ -kea_asiodns_lib = library('kea-asiodns', - 'asiodns_messages.cc', - 'asiodns_messages.h', - 'io_fetch.cc', - 'io_fetch.h', - 'logger.cc', - 'logger.h', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_asiodns_lib = library( + 'kea-asiodns', + 'asiodns_messages.cc', + 'asiodns_messages.h', + 'io_fetch.cc', + 'io_fetch.h', + 'logger.cc', + 'logger.h', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far = [kea_asiodns_lib] + libs_built_so_far +LIBS_BUILT_SO_FAR = [kea_asiodns_lib] + LIBS_BUILT_SO_FAR subdir('tests') diff --git a/src/lib/asiodns/tests/meson.build b/src/lib/asiodns/tests/meson.build index 148e83ae15..e628016d9e 100644 --- a/src/lib/asiodns/tests/meson.build +++ b/src/lib/asiodns/tests/meson.build @@ -1,8 +1,9 @@ -kea_asiodns_tests_exe = executable('kea-asiodns-tests', - 'io_fetch_unittest.cc', - 'run_unittests.cc', - dependencies: [gtest], - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far + [kea_testutils_lib, kea_util_unittests_lib], +kea_asiodns_tests = executable( + 'kea-asiodns-tests', + 'io_fetch_unittest.cc', + 'run_unittests.cc', + dependencies: [gtest], + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR + [kea_testutils_lib, kea_util_unittests_lib], ) -test('kea_asiodns_tests_exe', kea_asiodns_tests_exe) +test('kea_asiodns_tests', kea_asiodns_tests, protocol: 'gtest') diff --git a/src/lib/asiolink/meson.build b/src/lib/asiolink/meson.build index 661857d70f..72e49c917b 100644 --- a/src/lib/asiolink/meson.build +++ b/src/lib/asiolink/meson.build @@ -1,53 +1,54 @@ -kea_asiolink_lib = library('kea-asiolink', - 'addr_utilities.cc', - 'addr_utilities.h', - 'asiolink.h', - 'asio_wrapper.h', - 'botan_tls.cc', - 'botan_tls.h', - 'botan_wrapper.h', - 'common_tls.cc', - 'common_tls.h', - 'crypto_tls.h', - 'dummy_io_cb.h', - 'interval_timer.cc', - 'interval_timer.h', - 'io_acceptor.h', - 'io_address.cc', - 'io_address.h', - 'io_asio_socket.h', - 'io_endpoint.cc', - 'io_endpoint.h', - 'io_error.h', - 'io_service.cc', - 'io_service.h', - 'io_service_mgr.cc', - 'io_service_mgr.h', - 'io_service_signal.cc', - 'io_service_signal.h', - 'io_service_thread_pool.cc', - 'io_service_thread_pool.h', - 'io_socket.cc', - 'io_socket.h', - 'openssl_tls.cc', - 'openssl_tls.h', - 'process_spawn.cc', - 'process_spawn.h', - 'tcp_acceptor.h', - 'tcp_endpoint.h', - 'tcp_socket.h', - 'tls_acceptor.h', - 'tls_socket.h', - 'udp_endpoint.h', - 'udp_socket.h', - 'unix_domain_socket.cc', - 'unix_domain_socket.h', - 'unix_domain_socket_acceptor.h', - 'unix_domain_socket_endpoint.h', - dependencies: crypto, - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_asiolink_lib = library( + 'kea-asiolink', + 'addr_utilities.cc', + 'addr_utilities.h', + 'asiolink.h', + 'asio_wrapper.h', + 'botan_tls.cc', + 'botan_tls.h', + 'botan_wrapper.h', + 'common_tls.cc', + 'common_tls.h', + 'crypto_tls.h', + 'dummy_io_cb.h', + 'interval_timer.cc', + 'interval_timer.h', + 'io_acceptor.h', + 'io_address.cc', + 'io_address.h', + 'io_asio_socket.h', + 'io_endpoint.cc', + 'io_endpoint.h', + 'io_error.h', + 'io_service.cc', + 'io_service.h', + 'io_service_mgr.cc', + 'io_service_mgr.h', + 'io_service_signal.cc', + 'io_service_signal.h', + 'io_service_thread_pool.cc', + 'io_service_thread_pool.h', + 'io_socket.cc', + 'io_socket.h', + 'openssl_tls.cc', + 'openssl_tls.h', + 'process_spawn.cc', + 'process_spawn.h', + 'tcp_acceptor.h', + 'tcp_endpoint.h', + 'tcp_socket.h', + 'tls_acceptor.h', + 'tls_socket.h', + 'udp_endpoint.h', + 'udp_socket.h', + 'unix_domain_socket.cc', + 'unix_domain_socket.h', + 'unix_domain_socket_acceptor.h', + 'unix_domain_socket_endpoint.h', + dependencies: crypto, + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far += [kea_asiolink_lib] +LIBS_BUILT_SO_FAR = [kea_asiolink_lib] + LIBS_BUILT_SO_FAR diff --git a/src/lib/cc/meson.build b/src/lib/cc/meson.build index a1ed1a0450..50d5dd3794 100644 --- a/src/lib/cc/meson.build +++ b/src/lib/cc/meson.build @@ -1,29 +1,32 @@ -kea_cc_lib = library('kea-cc', - 'base_stamped_element.cc', - 'base_stamped_element.h', - 'cfg_to_element.h', - 'command_interpreter.cc', - 'command_interpreter.h', - 'data.cc', - 'data.h', - 'dhcp_config_error.h', - 'element_value.h', - 'json_feed.cc', - 'json_feed.h', - 'server_tag.cc', - 'server_tag.h', - 'simple_parser.cc', - 'simple_parser.h', - 'stamped_element.cc', - 'stamped_element.h', - 'stamped_value.cc', - 'stamped_value.h', - 'user_context.cc', - 'user_context.h', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_cc_lib = library( + 'kea-cc', + 'base_stamped_element.cc', + 'base_stamped_element.h', + 'cfg_to_element.h', + 'command_interpreter.cc', + 'command_interpreter.h', + 'data.cc', + 'data.h', + 'default_credentials.cc', + 'default_credentials.h', + 'dhcp_config_error.h', + 'element_value.h', + 'json_feed.cc', + 'json_feed.h', + 'server_tag.cc', + 'server_tag.h', + 'simple_parser.cc', + 'simple_parser.h', + 'stamped_element.cc', + 'stamped_element.h', + 'stamped_value.cc', + 'stamped_value.h', + 'user_context.cc', + 'user_context.h', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far = [kea_cc_lib] + libs_built_so_far +LIBS_BUILT_SO_FAR = [kea_cc_lib] + LIBS_BUILT_SO_FAR subdir('tests') diff --git a/src/lib/cc/tests/meson.build b/src/lib/cc/tests/meson.build index 188e5ae406..de5f171844 100644 --- a/src/lib/cc/tests/meson.build +++ b/src/lib/cc/tests/meson.build @@ -1,17 +1,18 @@ -kea_cc_tests_exe = executable('kea-cc-tests', - 'command_interpreter_unittests.cc', - 'data_file_unittests.cc', - 'data_unittests.cc', - 'element_value_unittests.cc', - 'json_feed_unittests.cc', - 'run_unittests.cc', - 'server_tag_unittest.cc', - 'simple_parser_unittest.cc', - 'stamped_element_unittest.cc', - 'stamped_value_unittest.cc', - 'user_context_unittests.cc', - dependencies: [gtest], - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far + [kea_util_unittests_lib], +kea_cc_tests = executable( + 'kea-cc-tests', + 'command_interpreter_unittests.cc', + 'data_file_unittests.cc', + 'data_unittests.cc', + 'element_value_unittests.cc', + 'json_feed_unittests.cc', + 'run_unittests.cc', + 'server_tag_unittest.cc', + 'simple_parser_unittest.cc', + 'stamped_element_unittest.cc', + 'stamped_value_unittest.cc', + 'user_context_unittests.cc', + dependencies: [gtest], + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR + [kea_util_unittests_lib], ) -test('kea_cc_tests_exe', kea_cc_tests_exe) +test('kea_cc_tests', kea_cc_tests, protocol: 'gtest') diff --git a/src/lib/config/meson.build b/src/lib/config/meson.build index f08f26a2af..09683a7f59 100644 --- a/src/lib/config/meson.build +++ b/src/lib/config/meson.build @@ -1,36 +1,39 @@ -kea_config_lib = library('kea-config', - 'base_command_mgr.cc', - 'base_command_mgr.h', - 'client_connection.cc', - 'client_connection.h', - 'cmds_impl.h', - 'cmd_http_listener.cc', - 'cmd_http_listener.h', - 'cmd_response_creator.cc', - 'cmd_response_creator.h', - 'cmd_response_creator_factory.h', - 'command_mgr.cc', - 'command_mgr.h', - 'config_log.cc', - 'config_log.h', - 'config_messages.cc', - 'config_messages.h', - 'hooked_command_mgr.cc', - 'hooked_command_mgr.h', - 'http_command_config.cc', - 'http_command_config.h', - 'http_command_mgr.cc', - 'http_command_mgr.h', - 'http_command_response_creator.cc', - 'http_command_response_creator.h', - 'http_command_response_creator_factory.h', - 'timeouts.h', - 'unix_command_mgr.cc', - 'unix_command_mgr.h', - dependencies: [crypto], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_config_lib = library( + 'kea-config', + 'base_command_mgr.cc', + 'base_command_mgr.h', + 'client_connection.cc', + 'client_connection.h', + 'cmds_impl.h', + 'cmd_http_listener.cc', + 'cmd_http_listener.h', + 'cmd_response_creator.cc', + 'cmd_response_creator.h', + 'cmd_response_creator_factory.h', + 'command_mgr.cc', + 'command_mgr.h', + 'config_log.cc', + 'config_log.h', + 'config_messages.cc', + 'config_messages.h', + 'hooked_command_mgr.cc', + 'hooked_command_mgr.h', + 'http_command_config.cc', + 'http_command_config.h', + 'http_command_mgr.cc', + 'http_command_mgr.h', + 'http_command_response_creator.cc', + 'http_command_response_creator.h', + 'http_command_response_creator_factory.h', + 'timeouts.h', + 'unix_command_config.cc', + 'unix_command_config.h', + 'unix_command_mgr.cc', + 'unix_command_mgr.h', + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far += [kea_config_lib] +LIBS_BUILT_SO_FAR = [kea_config_lib] + LIBS_BUILT_SO_FAR diff --git a/src/lib/config_backend/meson.build b/src/lib/config_backend/meson.build index 271aefc576..3a5a390882 100644 --- a/src/lib/config_backend/meson.build +++ b/src/lib/config_backend/meson.build @@ -1,12 +1,13 @@ -kea_config_backend_lib = library('kea-config_backend', - 'base_config_backend.h', - 'base_config_backend_mgr.h', - 'base_config_backend_pool.h', - 'constants.h', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_config_backend_lib = library( + 'kea-config_backend', + 'base_config_backend.h', + 'base_config_backend_mgr.h', + 'base_config_backend_pool.h', + 'constants.h', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far = [kea_config_backend_lib] + libs_built_so_far +LIBS_BUILT_SO_FAR = [kea_config_backend_lib] + LIBS_BUILT_SO_FAR subdir('tests') diff --git a/src/lib/config_backend/tests/meson.build b/src/lib/config_backend/tests/meson.build index 4f02fe0b69..0c96928436 100644 --- a/src/lib/config_backend/tests/meson.build +++ b/src/lib/config_backend/tests/meson.build @@ -1,8 +1,9 @@ -kea_config_backend_tests_exe = executable('kea-config_backend-tests', - 'config_backend_mgr_unittest.cc', - 'run_unittests.cc', - dependencies: [gtest], - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far + [kea_testutils_lib, kea_util_unittests_lib], +kea_config_backend_tests = executable( + 'kea-config_backend-tests', + 'config_backend_mgr_unittest.cc', + 'run_unittests.cc', + dependencies: [gtest], + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR + [kea_testutils_lib, kea_util_unittests_lib], ) -test('kea_config_backend_tests_exe', kea_config_backend_tests_exe) +test('kea_config_backend_tests', kea_config_backend_tests, protocol: 'gtest') diff --git a/src/lib/cryptolink/meson.build b/src/lib/cryptolink/meson.build index c9cd37ae6c..f1e12f5bfb 100644 --- a/src/lib/cryptolink/meson.build +++ b/src/lib/cryptolink/meson.build @@ -1,21 +1,36 @@ -kea_cryptolink_lib = library('kea-cryptolink', - 'cryptolink.cc', - 'cryptolink.h', - 'crypto_hash.cc', - 'crypto_hash.h', - 'crypto_hmac.cc', - 'crypto_hmac.h', - 'crypto_rng.cc', - 'crypto_rng.h', - 'openssl_common.h', - 'openssl_hash.cc', - 'openssl_hmac.cc', - 'openssl_link.cc', - dependencies: [crypto], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +sources = [] +if crypto == botan + sources += [ + 'botan_common.h', + 'botan_hash.cc', + 'botan_hmac.cc', + 'botan_link.cc', + ] +elif crypto == openssl + sources += [ + 'openssl_common.h', + 'openssl_hash.cc', + 'openssl_hmac.cc', + 'openssl_link.cc', + ] +endif + +kea_cryptolink_lib = library( + 'kea-cryptolink', + 'cryptolink.cc', + 'cryptolink.h', + 'crypto_hash.cc', + 'crypto_hash.h', + 'crypto_hmac.cc', + 'crypto_hmac.h', + 'crypto_rng.cc', + 'crypto_rng.h', + sources, + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far = [kea_cryptolink_lib] + libs_built_so_far +LIBS_BUILT_SO_FAR = [kea_cryptolink_lib] + LIBS_BUILT_SO_FAR subdir('tests') diff --git a/src/lib/cryptolink/tests/meson.build b/src/lib/cryptolink/tests/meson.build index 2e648700ac..c738053e89 100644 --- a/src/lib/cryptolink/tests/meson.build +++ b/src/lib/cryptolink/tests/meson.build @@ -1,10 +1,11 @@ -kea_cryptolink_tests_exe = executable('kea-cryptolink-tests', - 'crypto_unittests.cc', - 'hash_unittests.cc', - 'hmac_unittests.cc', - 'run_unittests.cc', - dependencies: [gtest], - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far + [kea_util_unittests_lib], +kea_cryptolink_tests = executable( + 'kea-cryptolink-tests', + 'crypto_unittests.cc', + 'hash_unittests.cc', + 'hmac_unittests.cc', + 'run_unittests.cc', + dependencies: [gtest], + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR + [kea_util_unittests_lib], ) -test('kea_cryptolink_tests_exe', kea_cryptolink_tests_exe) +test('kea_cryptolink_tests', kea_cryptolink_tests, protocol: 'gtest') diff --git a/src/lib/d2srv/meson.build b/src/lib/d2srv/meson.build index a8cb46a610..6ac4a732f9 100644 --- a/src/lib/d2srv/meson.build +++ b/src/lib/d2srv/meson.build @@ -1,29 +1,31 @@ -kea_d2srv_lib = library('kea-d2srv', - 'd2_cfg_mgr.cc', - 'd2_cfg_mgr.h', - 'd2_config.cc', - 'd2_config.h', - 'd2_log.cc', - 'd2_log.h', - 'd2_messages.cc', - 'd2_messages.h', - 'd2_simple_parser.cc', - 'd2_simple_parser.h', - 'd2_stats.cc', - 'd2_stats.h', - 'd2_tsig_key.cc', - 'd2_tsig_key.h', - 'd2_update_message.cc', - 'd2_update_message.h', - 'd2_zone.cc', - 'd2_zone.h', - 'dns_client.cc', - 'dns_client.h', - 'nc_trans.cc', - 'nc_trans.h', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_d2srv_lib = library( + 'kea-d2srv', + 'd2_cfg_mgr.cc', + 'd2_cfg_mgr.h', + 'd2_config.cc', + 'd2_config.h', + 'd2_log.cc', + 'd2_log.h', + 'd2_messages.cc', + 'd2_messages.h', + 'd2_simple_parser.cc', + 'd2_simple_parser.h', + 'd2_stats.cc', + 'd2_stats.h', + 'd2_tsig_key.cc', + 'd2_tsig_key.h', + 'd2_update_message.cc', + 'd2_update_message.h', + 'd2_zone.cc', + 'd2_zone.h', + 'dns_client.cc', + 'dns_client.h', + 'nc_trans.cc', + 'nc_trans.h', + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far += [kea_d2srv_lib] +LIBS_BUILT_SO_FAR = [kea_d2srv_lib] + LIBS_BUILT_SO_FAR diff --git a/src/lib/database/meson.build b/src/lib/database/meson.build index cea31a6536..cd70f1eb77 100644 --- a/src/lib/database/meson.build +++ b/src/lib/database/meson.build @@ -1,27 +1,28 @@ -kea_database_lib = library('kea-database', - 'audit_entry.cc', - 'audit_entry.h', - 'backend_selector.cc', - 'backend_selector.h', - 'database_connection.cc', - 'database_connection.h', - 'dbaccess_parser.cc', - 'dbaccess_parser.h', - 'db_exceptions.h', - 'db_log.cc', - 'db_log.h', - 'db_messages.cc', - 'db_messages.h', - 'server.cc', - 'server.h', - 'server_collection.cc', - 'server_collection.h', - 'server_selector.cc', - 'server_selector.h', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_database_lib = library( + 'kea-database', + 'audit_entry.cc', + 'audit_entry.h', + 'backend_selector.cc', + 'backend_selector.h', + 'database_connection.cc', + 'database_connection.h', + 'dbaccess_parser.cc', + 'dbaccess_parser.h', + 'db_exceptions.h', + 'db_log.cc', + 'db_log.h', + 'db_messages.cc', + 'db_messages.h', + 'server.cc', + 'server.h', + 'server_collection.cc', + 'server_collection.h', + 'server_selector.cc', + 'server_selector.h', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far = [kea_database_lib] + libs_built_so_far +LIBS_BUILT_SO_FAR = [kea_database_lib] + LIBS_BUILT_SO_FAR subdir('tests') diff --git a/src/lib/database/tests/meson.build b/src/lib/database/tests/meson.build index f614252bf7..37b69723e2 100644 --- a/src/lib/database/tests/meson.build +++ b/src/lib/database/tests/meson.build @@ -1,14 +1,15 @@ -kea_database_tests_exe = executable('kea-database-tests', - 'audit_entry_unittest.cc', - 'backend_selector_unittest.cc', - 'database_connection_unittest.cc', - 'database_log_unittest.cc', - 'dbaccess_parser_unittest.cc', - 'run_unittests.cc', - 'server_selector_unittest.cc', - 'server_unittest.cc', - dependencies: [gtest], - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far + [kea_testutils_lib, kea_util_unittests_lib], +kea_database_tests = executable( + 'kea-database-tests', + 'audit_entry_unittest.cc', + 'backend_selector_unittest.cc', + 'database_connection_unittest.cc', + 'database_log_unittest.cc', + 'dbaccess_parser_unittest.cc', + 'run_unittests.cc', + 'server_selector_unittest.cc', + 'server_unittest.cc', + dependencies: [gtest], + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR + [kea_testutils_lib, kea_util_unittests_lib], ) -test('kea_database_tests_exe', kea_database_tests_exe) +test('kea_database_tests', kea_database_tests, protocol: 'gtest') diff --git a/src/lib/dhcp/meson.build b/src/lib/dhcp/meson.build index 85f9b8bf0a..7b072a4800 100644 --- a/src/lib/dhcp/meson.build +++ b/src/lib/dhcp/meson.build @@ -1,119 +1,118 @@ -system = build_machine.system() pkt_filter_cc = 'pkt_filter_bpf.cc' pkt_filter_h = 'pkt_filter_bpf.h' -if system == 'linux' - iface_mgr = 'iface_mgr_linux.cc' - pkt_filter_cc = 'pkt_filter_lpf.cc' - pkt_filter_h = 'pkt_filter_lpf.h' -elif system == 'freebsd' or system == 'netbsd' or system == 'openbsd' or system == 'darwin' - iface_mgr = 'iface_mgr_bsd.cc' -elif system == 'sun' - iface_mgr = 'iface_mgr_sun.cc' -elif system == 'osx' +if SYSTEM == 'linux' + iface_mgr = 'iface_mgr_linux.cc' + pkt_filter_cc = 'pkt_filter_lpf.cc' + pkt_filter_h = 'pkt_filter_lpf.h' +elif SYSTEM == 'freebsd' or SYSTEM == 'netbsd' or SYSTEM == 'openbsd' or SYSTEM == 'darwin' + iface_mgr = 'iface_mgr_bsd.cc' +elif SYSTEM == 'sun' + iface_mgr = 'iface_mgr_sun.cc' else - error(f'Build failed: Unsupported system "@system@".') + error(f'Build failed: Unsupported system "@SYSTEM@".') endif -kea_dhcp_lib = library('kea-dhcp', - 'classify.cc', - 'classify.h', - 'dhcp4.h', - 'dhcp6.h', - 'docsis3_option_defs.h', - 'duid.cc', - 'duid.h', - 'duid_factory.cc', - 'duid_factory.h', - 'hwaddr.cc', - 'hwaddr.h', - 'iface_mgr.cc', - 'iface_mgr.h', - 'iface_mgr_error_handler.h', - iface_mgr, - 'libdhcp++.cc', - 'libdhcp++.h', - 'opaque_data_tuple.cc', - 'opaque_data_tuple.h', - 'option.cc', - 'option.h', - 'option4_addrlst.cc', - 'option4_addrlst.h', - 'option4_client_fqdn.cc', - 'option4_client_fqdn.h', - 'option4_dnr.cc', - 'option4_dnr.h', - 'option6_addrlst.cc', - 'option6_addrlst.h', - 'option6_auth.cc', - 'option6_auth.h', - 'option6_client_fqdn.cc', - 'option6_client_fqdn.h', - 'option6_dnr.cc', - 'option6_dnr.h', - 'option6_ia.cc', - 'option6_ia.h', - 'option6_iaaddr.cc', - 'option6_iaaddr.h', - 'option6_iaprefix.cc', - 'option6_iaprefix.h', - 'option6_pdexclude.cc', - 'option6_pdexclude.h', - 'option6_status_code.cc', - 'option6_status_code.h', - 'option_classless_static_route.cc', - 'option_classless_static_route.h', - 'option_custom.cc', - 'option_custom.h', - 'option_data_types.cc', - 'option_data_types.h', - 'option_definition.cc', - 'option_definition.h', - 'option_int.h', - 'option_int_array.h', - 'option_opaque_data_tuples.cc', - 'option_opaque_data_tuples.h', - 'option_space.cc', - 'option_space.h', - 'option_space_container.h', - 'option_string.cc', - 'option_string.h', - 'option_vendor.cc', - 'option_vendor.h', - 'option_vendor_class.cc', - 'option_vendor_class.h', - 'packet_queue.h', - 'packet_queue_mgr.h', - 'packet_queue_mgr4.cc', - 'packet_queue_mgr4.h', - 'packet_queue_mgr6.cc', - 'packet_queue_mgr6.h', - 'packet_queue_ring.h', - 'pkt.cc', - 'pkt.h', - 'pkt4.cc', - 'pkt4.h', - 'pkt4o6.cc', - 'pkt4o6.h', - 'pkt6.cc', - 'pkt6.h', - 'pkt_filter.cc', - 'pkt_filter.h', - 'pkt_filter6.cc', - 'pkt_filter6.h', - 'pkt_filter_inet.cc', - 'pkt_filter_inet.h', - 'pkt_filter_inet6.cc', - 'pkt_filter_inet6.h', - pkt_filter_cc, - pkt_filter_h, - 'pkt_template.h', - 'protocol_util.cc', - 'protocol_util.h', - 'socket_info.h', - 'std_option_defs.h', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_dhcp_lib = library( + 'kea-dhcp', + 'classify.cc', + 'classify.h', + 'dhcp4.h', + 'dhcp6.h', + 'docsis3_option_defs.h', + 'duid.cc', + 'duid.h', + 'duid_factory.cc', + 'duid_factory.h', + 'hwaddr.cc', + 'hwaddr.h', + 'iface_mgr.cc', + 'iface_mgr.h', + 'iface_mgr_error_handler.h', + iface_mgr, + 'libdhcp++.cc', + 'libdhcp++.h', + 'opaque_data_tuple.cc', + 'opaque_data_tuple.h', + 'option.cc', + 'option.h', + 'option4_addrlst.cc', + 'option4_addrlst.h', + 'option4_client_fqdn.cc', + 'option4_client_fqdn.h', + 'option4_dnr.cc', + 'option4_dnr.h', + 'option6_addrlst.cc', + 'option6_addrlst.h', + 'option6_auth.cc', + 'option6_auth.h', + 'option6_client_fqdn.cc', + 'option6_client_fqdn.h', + 'option6_dnr.cc', + 'option6_dnr.h', + 'option6_ia.cc', + 'option6_ia.h', + 'option6_iaaddr.cc', + 'option6_iaaddr.h', + 'option6_iaprefix.cc', + 'option6_iaprefix.h', + 'option6_pdexclude.cc', + 'option6_pdexclude.h', + 'option6_status_code.cc', + 'option6_status_code.h', + 'option_classless_static_route.cc', + 'option_classless_static_route.h', + 'option_custom.cc', + 'option_custom.h', + 'option_data_types.cc', + 'option_data_types.h', + 'option_definition.cc', + 'option_definition.h', + 'option_int.h', + 'option_int_array.h', + 'option_opaque_data_tuples.cc', + 'option_opaque_data_tuples.h', + 'option_space.cc', + 'option_space.h', + 'option_space_container.h', + 'option_string.cc', + 'option_string.h', + 'option_vendor.cc', + 'option_vendor.h', + 'option_vendor_class.cc', + 'option_vendor_class.h', + 'packet_queue.h', + 'packet_queue_mgr.h', + 'packet_queue_mgr4.cc', + 'packet_queue_mgr4.h', + 'packet_queue_mgr6.cc', + 'packet_queue_mgr6.h', + 'packet_queue_ring.h', + 'pkt.cc', + 'pkt.h', + 'pkt4.cc', + 'pkt4.h', + 'pkt4o6.cc', + 'pkt4o6.h', + 'pkt6.cc', + 'pkt6.h', + 'pkt_filter.cc', + 'pkt_filter.h', + 'pkt_filter6.cc', + 'pkt_filter6.h', + 'pkt_filter_inet.cc', + 'pkt_filter_inet.h', + 'pkt_filter_inet6.cc', + 'pkt_filter_inet6.h', + pkt_filter_cc, + pkt_filter_h, + 'pkt_template.h', + 'protocol_util.cc', + 'protocol_util.h', + 'socket_info.h', + 'std_option_defs.h', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far += [kea_dhcp_lib] +LIBS_BUILT_SO_FAR = [kea_dhcp_lib] + LIBS_BUILT_SO_FAR diff --git a/src/lib/dhcp_ddns/meson.build b/src/lib/dhcp_ddns/meson.build index b438c9624d..4ffd0240cd 100644 --- a/src/lib/dhcp_ddns/meson.build +++ b/src/lib/dhcp_ddns/meson.build @@ -1,18 +1,19 @@ -kea_dhcp_ddns_lib = library('kea-dhcp_ddns', - 'dhcp_ddns_log.cc', - 'dhcp_ddns_log.h', - 'dhcp_ddns_messages.cc', - 'dhcp_ddns_messages.h', - 'ncr_io.cc', - 'ncr_io.h', - 'ncr_msg.cc', - 'ncr_msg.h', - 'ncr_udp.cc', - 'ncr_udp.h', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_dhcp_ddns_lib = library( + 'kea-dhcp_ddns', + 'dhcp_ddns_log.cc', + 'dhcp_ddns_log.h', + 'dhcp_ddns_messages.cc', + 'dhcp_ddns_messages.h', + 'ncr_io.cc', + 'ncr_io.h', + 'ncr_msg.cc', + 'ncr_msg.h', + 'ncr_udp.cc', + 'ncr_udp.h', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far = [kea_dhcp_ddns_lib] + libs_built_so_far +LIBS_BUILT_SO_FAR = [kea_dhcp_ddns_lib] + LIBS_BUILT_SO_FAR subdir('tests') diff --git a/src/lib/dhcp_ddns/tests/meson.build b/src/lib/dhcp_ddns/tests/meson.build index 674790c304..e513818d92 100644 --- a/src/lib/dhcp_ddns/tests/meson.build +++ b/src/lib/dhcp_ddns/tests/meson.build @@ -1,11 +1,12 @@ -kea_dhcp_ddns_tests_exe = executable('kea-dhcp_ddns-tests', - 'ncr_udp_unittests.cc', - 'ncr_unittests.cc', - 'run_unittests.cc', - 'test_utils.cc', - 'test_utils.h', - dependencies: [gtest], - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far + [kea_testutils_lib, kea_util_unittests_lib], +kea_dhcp_ddns_tests = executable( + 'kea-dhcp_ddns-tests', + 'ncr_udp_unittests.cc', + 'ncr_unittests.cc', + 'run_unittests.cc', + 'test_utils.cc', + 'test_utils.h', + dependencies: [gtest], + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR + [kea_testutils_lib, kea_util_unittests_lib], ) -test('kea_dhcp_ddns_tests_exe', kea_dhcp_ddns_tests_exe) +test('kea_dhcp_ddns_tests', kea_dhcp_ddns_tests, protocol: 'gtest') diff --git a/src/lib/dhcpsrv/meson.build b/src/lib/dhcpsrv/meson.build index 4f83be84cd..e3b39e8504 100644 --- a/src/lib/dhcpsrv/meson.build +++ b/src/lib/dhcpsrv/meson.build @@ -1,195 +1,202 @@ -kea_dhcpsrv_lib = library('kea-dhcpsrv', - 'allocation_state.cc', - 'allocation_state.h', - 'allocator.cc', - 'allocator.h', - 'alloc_engine.cc', - 'alloc_engine.h', - 'alloc_engine_log.cc', - 'alloc_engine_log.h', - 'alloc_engine_messages.cc', - 'alloc_engine_messages.h', - 'base_host_data_source.h', - 'cache_host_data_source.h', - 'callout_handle_store.h', - 'cb_ctl_dhcp.h', - 'cb_ctl_dhcp4.cc', - 'cb_ctl_dhcp4.h', - 'cb_ctl_dhcp6.cc', - 'cb_ctl_dhcp6.h', - 'cfgmgr.cc', - 'cfgmgr.h', - 'cfg_4o6.cc', - 'cfg_4o6.h', - 'cfg_consistency.cc', - 'cfg_consistency.h', - 'cfg_db_access.cc', - 'cfg_db_access.h', - 'cfg_duid.cc', - 'cfg_duid.h', - 'cfg_expiration.cc', - 'cfg_expiration.h', - 'cfg_globals.cc', - 'cfg_globals.h', - 'cfg_hosts.cc', - 'cfg_hosts.h', - 'cfg_hosts_util.cc', - 'cfg_hosts_util.h', - 'cfg_host_operations.cc', - 'cfg_host_operations.h', - 'cfg_iface.cc', - 'cfg_iface.h', - 'cfg_mac_source.cc', - 'cfg_mac_source.h', - 'cfg_multi_threading.cc', - 'cfg_multi_threading.h', - 'cfg_option.cc', - 'cfg_option.h', - 'cfg_option_def.cc', - 'cfg_option_def.h', - 'cfg_rsoo.cc', - 'cfg_rsoo.h', - 'cfg_shared_networks.cc', - 'cfg_shared_networks.h', - 'cfg_subnets4.cc', - 'cfg_subnets4.h', - 'cfg_subnets6.cc', - 'cfg_subnets6.h', - 'client_class_def.cc', - 'client_class_def.h', - 'config_backend_dhcp4.h', - 'config_backend_dhcp4_mgr.cc', - 'config_backend_dhcp4_mgr.h', - 'config_backend_dhcp6.h', - 'config_backend_dhcp6_mgr.cc', - 'config_backend_dhcp6_mgr.h', - 'config_backend_pool_dhcp4.cc', - 'config_backend_pool_dhcp4.h', - 'config_backend_pool_dhcp6.cc', - 'config_backend_pool_dhcp6.h', - 'csv_lease_file4.cc', - 'csv_lease_file4.h', - 'csv_lease_file6.cc', - 'csv_lease_file6.h', - 'd2_client_cfg.cc', - 'd2_client_cfg.h', - 'd2_client_mgr.cc', - 'd2_client_mgr.h', - 'db_type.h', - 'dhcp4o6_ipc.cc', - 'dhcp4o6_ipc.h', - 'dhcpsrv_exceptions.h', - 'dhcpsrv_log.cc', - 'dhcpsrv_log.h', - 'dhcpsrv_messages.cc', - 'dhcpsrv_messages.h', - 'flq_allocation_state.cc', - 'flq_allocation_state.h', - 'flq_allocator.cc', - 'flq_allocator.h', - 'fuzz_log.cc', - 'fuzz_log.h', - 'fuzz_messages.cc', - 'fuzz_messages.h', - 'host.cc', - 'host.h', - 'hosts_log.cc', - 'hosts_log.h', - 'hosts_messages.cc', - 'hosts_messages.h', - 'host_container.h', - 'host_data_source_factory.cc', - 'host_data_source_factory.h', - 'host_mgr.cc', - 'host_mgr.h', - 'ip_range.cc', - 'ip_range.h', - 'ip_range_permutation.cc', - 'ip_range_permutation.h', - 'iterative_allocation_state.cc', - 'iterative_allocation_state.h', - 'iterative_allocator.cc', - 'iterative_allocator.h', - 'key_from_key.h', - 'lease.cc', - 'lease.h', - 'lease_file_loader.h', - 'lease_file_stats.h', - 'lease_mgr.cc', - 'lease_mgr.h', - 'lease_mgr_factory.cc', - 'lease_mgr_factory.h', - 'memfile_lease_limits.cc', - 'memfile_lease_limits.h', - 'memfile_lease_mgr.cc', - 'memfile_lease_mgr.h', - 'memfile_lease_storage.h', - 'ncr_generator.cc', - 'ncr_generator.h', - 'network.cc', - 'network.h', - 'network_state.cc', - 'network_state.h', - 'packet_fuzzer.cc', - 'packet_fuzzer.h', - 'parsers/base_network_parser.cc', - 'parsers/base_network_parser.h', - 'parsers/client_class_def_parser.cc', - 'parsers/client_class_def_parser.h', - 'parsers/dhcp_parsers.cc', - 'parsers/dhcp_parsers.h', - 'parsers/dhcp_queue_control_parser.cc', - 'parsers/dhcp_queue_control_parser.h', - 'parsers/duid_config_parser.cc', - 'parsers/duid_config_parser.h', - 'parsers/expiration_config_parser.cc', - 'parsers/expiration_config_parser.h', - 'parsers/host_reservations_list_parser.h', - 'parsers/host_reservation_parser.cc', - 'parsers/host_reservation_parser.h', - 'parsers/ifaces_config_parser.cc', - 'parsers/ifaces_config_parser.h', - 'parsers/multi_threading_config_parser.cc', - 'parsers/multi_threading_config_parser.h', - 'parsers/option_data_parser.cc', - 'parsers/option_data_parser.h', - 'parsers/sanity_checks_parser.cc', - 'parsers/sanity_checks_parser.h', - 'parsers/shared_networks_list_parser.h', - 'parsers/shared_network_parser.cc', - 'parsers/shared_network_parser.h', - 'parsers/simple_parser4.cc', - 'parsers/simple_parser4.h', - 'parsers/simple_parser6.cc', - 'parsers/simple_parser6.h', - 'pool.cc', - 'pool.h', - 'random_allocation_state.cc', - 'random_allocation_state.h', - 'random_allocator.cc', - 'random_allocator.h', - 'resource_handler.cc', - 'resource_handler.h', - 'sanity_checker.cc', - 'sanity_checker.h', - 'shared_network.cc', - 'shared_network.h', - 'srv_config.cc', - 'srv_config.h', - 'subnet.cc', - 'subnet.h', - 'subnet_id.h', - 'subnet_selector.h', - 'timer_mgr.cc', - 'timer_mgr.h', - 'tracking_lease_mgr.cc', - 'tracking_lease_mgr.h', - 'utils.h', - 'writable_host_data_source.h', - cpp_args: ['-DDHCP_DATA_DIR="@0@"'.format(meson.current_build_dir()), f'-DKEA_LFC_EXECUTABLE="@kea_lfc@"'], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_dhcpsrv_lib = library( + 'kea-dhcpsrv', + 'allocation_state.cc', + 'allocation_state.h', + 'allocator.cc', + 'allocator.h', + 'alloc_engine.cc', + 'alloc_engine.h', + 'alloc_engine_log.cc', + 'alloc_engine_log.h', + 'alloc_engine_messages.cc', + 'alloc_engine_messages.h', + 'base_host_data_source.h', + 'cache_host_data_source.h', + 'callout_handle_store.h', + 'cb_ctl_dhcp.h', + 'cb_ctl_dhcp4.cc', + 'cb_ctl_dhcp4.h', + 'cb_ctl_dhcp6.cc', + 'cb_ctl_dhcp6.h', + 'cfgmgr.cc', + 'cfgmgr.h', + 'cfg_4o6.cc', + 'cfg_4o6.h', + 'cfg_consistency.cc', + 'cfg_consistency.h', + 'cfg_db_access.cc', + 'cfg_db_access.h', + 'cfg_duid.cc', + 'cfg_duid.h', + 'cfg_expiration.cc', + 'cfg_expiration.h', + 'cfg_globals.cc', + 'cfg_globals.h', + 'cfg_hosts.cc', + 'cfg_hosts.h', + 'cfg_hosts_util.cc', + 'cfg_hosts_util.h', + 'cfg_host_operations.cc', + 'cfg_host_operations.h', + 'cfg_iface.cc', + 'cfg_iface.h', + 'cfg_mac_source.cc', + 'cfg_mac_source.h', + 'cfg_multi_threading.cc', + 'cfg_multi_threading.h', + 'cfg_option.cc', + 'cfg_option.h', + 'cfg_option_def.cc', + 'cfg_option_def.h', + 'cfg_rsoo.cc', + 'cfg_rsoo.h', + 'cfg_shared_networks.cc', + 'cfg_shared_networks.h', + 'cfg_subnets4.cc', + 'cfg_subnets4.h', + 'cfg_subnets6.cc', + 'cfg_subnets6.h', + 'client_class_def.cc', + 'client_class_def.h', + 'config_backend_dhcp4.h', + 'config_backend_dhcp4_mgr.cc', + 'config_backend_dhcp4_mgr.h', + 'config_backend_dhcp6.h', + 'config_backend_dhcp6_mgr.cc', + 'config_backend_dhcp6_mgr.h', + 'config_backend_pool_dhcp4.cc', + 'config_backend_pool_dhcp4.h', + 'config_backend_pool_dhcp6.cc', + 'config_backend_pool_dhcp6.h', + 'csv_lease_file4.cc', + 'csv_lease_file4.h', + 'csv_lease_file6.cc', + 'csv_lease_file6.h', + 'd2_client_cfg.cc', + 'd2_client_cfg.h', + 'd2_client_mgr.cc', + 'd2_client_mgr.h', + 'db_type.h', + 'ddns_params.cc', + 'ddns_params.h', + 'dhcp4o6_ipc.cc', + 'dhcp4o6_ipc.h', + 'dhcpsrv_exceptions.h', + 'dhcpsrv_log.cc', + 'dhcpsrv_log.h', + 'dhcpsrv_messages.cc', + 'dhcpsrv_messages.h', + 'flq_allocation_state.cc', + 'flq_allocation_state.h', + 'flq_allocator.cc', + 'flq_allocator.h', + 'fuzz_log.cc', + 'fuzz_log.h', + 'fuzz_messages.cc', + 'fuzz_messages.h', + 'host.cc', + 'host.h', + 'hosts_log.cc', + 'hosts_log.h', + 'hosts_messages.cc', + 'hosts_messages.h', + 'host_container.h', + 'host_data_source_factory.cc', + 'host_data_source_factory.h', + 'host_mgr.cc', + 'host_mgr.h', + 'ip_range.cc', + 'ip_range.h', + 'ip_range_permutation.cc', + 'ip_range_permutation.h', + 'iterative_allocation_state.cc', + 'iterative_allocation_state.h', + 'iterative_allocator.cc', + 'iterative_allocator.h', + 'key_from_key.h', + 'lease.cc', + 'lease.h', + 'lease_file_loader.h', + 'lease_file_stats.h', + 'lease_mgr.cc', + 'lease_mgr.h', + 'lease_mgr_factory.cc', + 'lease_mgr_factory.h', + 'memfile_lease_limits.cc', + 'memfile_lease_limits.h', + 'memfile_lease_mgr.cc', + 'memfile_lease_mgr.h', + 'memfile_lease_storage.h', + 'ncr_generator.cc', + 'ncr_generator.h', + 'network.cc', + 'network.h', + 'network_state.cc', + 'network_state.h', + 'packet_fuzzer.cc', + 'packet_fuzzer.h', + 'parsers/base_network_parser.cc', + 'parsers/base_network_parser.h', + 'parsers/client_class_def_parser.cc', + 'parsers/client_class_def_parser.h', + 'parsers/dhcp_parsers.cc', + 'parsers/dhcp_parsers.h', + 'parsers/dhcp_queue_control_parser.cc', + 'parsers/dhcp_queue_control_parser.h', + 'parsers/duid_config_parser.cc', + 'parsers/duid_config_parser.h', + 'parsers/expiration_config_parser.cc', + 'parsers/expiration_config_parser.h', + 'parsers/host_reservations_list_parser.h', + 'parsers/host_reservation_parser.cc', + 'parsers/host_reservation_parser.h', + 'parsers/ifaces_config_parser.cc', + 'parsers/ifaces_config_parser.h', + 'parsers/multi_threading_config_parser.cc', + 'parsers/multi_threading_config_parser.h', + 'parsers/option_data_parser.cc', + 'parsers/option_data_parser.h', + 'parsers/sanity_checks_parser.cc', + 'parsers/sanity_checks_parser.h', + 'parsers/shared_networks_list_parser.h', + 'parsers/shared_network_parser.cc', + 'parsers/shared_network_parser.h', + 'parsers/simple_parser4.cc', + 'parsers/simple_parser4.h', + 'parsers/simple_parser6.cc', + 'parsers/simple_parser6.h', + 'pool.cc', + 'pool.h', + 'random_allocation_state.cc', + 'random_allocation_state.h', + 'random_allocator.cc', + 'random_allocator.h', + 'resource_handler.cc', + 'resource_handler.h', + 'sanity_checker.cc', + 'sanity_checker.h', + 'shared_network.cc', + 'shared_network.h', + 'srv_config.cc', + 'srv_config.h', + 'subnet.cc', + 'subnet.h', + 'subnet_id.h', + 'subnet_selector.h', + 'timer_mgr.cc', + 'timer_mgr.h', + 'tracking_lease_mgr.cc', + 'tracking_lease_mgr.h', + 'utils.h', + 'writable_host_data_source.h', + cpp_args: [ + f'-DDHCP_DATA_DIR="@TOP_BUILD_DIR@"', + f'-DKEA_LFC_EXECUTABLE="@KEA_LFC@"', + ], + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far += [kea_dhcpsrv_lib] +LIBS_BUILT_SO_FAR = [kea_dhcpsrv_lib] + LIBS_BUILT_SO_FAR diff --git a/src/lib/dns/meson.build b/src/lib/dns/meson.build index 8502661013..9eeb42cff4 100644 --- a/src/lib/dns/meson.build +++ b/src/lib/dns/meson.build @@ -1,64 +1,65 @@ -kea_dns_lib = library('kea-dns', - 'char_string.cc', - 'char_string.h', - 'edns.cc', - 'edns.h', - 'exceptions.cc', - 'exceptions.h', - 'labelsequence.cc', - 'labelsequence.h', - 'master_lexer.cc', - 'master_lexer.h', - 'master_lexer_inputsource.cc', - 'master_lexer_inputsource.h', - 'master_lexer_state.h', - 'master_loader.cc', - 'master_loader.h', - 'master_loader_callbacks.h', - 'message.cc', - 'message.h', - 'messagerenderer.cc', - 'messagerenderer.h', - 'name.cc', - 'name.h', - 'name_internal.h', - 'opcode.cc', - 'opcode.h', - 'question.cc', - 'question.h', - 'rcode.cc', - 'rcode.h', - 'rdata.cc', - 'rdata.h', - 'rdataclass.cc', - 'rdataclass.h', - 'rrclass.cc', - 'rrclass.h', - 'rrparamregistry.cc', - 'rrparamregistry.h', - 'rrset.cc', - 'rrset.h', - 'rrttl.cc', - 'rrttl.h', - 'rrtype.cc', - 'rrtype.h', - 'serial.cc', - 'serial.h', - 'time_utils.cc', - 'time_utils.h', - 'tsig.cc', - 'tsig.h', - 'tsigerror.cc', - 'tsigerror.h', - 'tsigkey.cc', - 'tsigkey.h', - 'tsigrecord.cc', - 'tsigrecord.h', - 'txt_like.h', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_dns_lib = library( + 'kea-dns', + 'char_string.cc', + 'char_string.h', + 'edns.cc', + 'edns.h', + 'exceptions.cc', + 'exceptions.h', + 'labelsequence.cc', + 'labelsequence.h', + 'master_lexer.cc', + 'master_lexer.h', + 'master_lexer_inputsource.cc', + 'master_lexer_inputsource.h', + 'master_lexer_state.h', + 'master_loader.cc', + 'master_loader.h', + 'master_loader_callbacks.h', + 'message.cc', + 'message.h', + 'messagerenderer.cc', + 'messagerenderer.h', + 'name.cc', + 'name.h', + 'name_internal.h', + 'opcode.cc', + 'opcode.h', + 'question.cc', + 'question.h', + 'rcode.cc', + 'rcode.h', + 'rdata.cc', + 'rdata.h', + 'rdataclass.cc', + 'rdataclass.h', + 'rrclass.cc', + 'rrclass.h', + 'rrparamregistry.cc', + 'rrparamregistry.h', + 'rrset.cc', + 'rrset.h', + 'rrttl.cc', + 'rrttl.h', + 'rrtype.cc', + 'rrtype.h', + 'serial.cc', + 'serial.h', + 'time_utils.cc', + 'time_utils.h', + 'tsig.cc', + 'tsig.h', + 'tsigerror.cc', + 'tsigerror.h', + 'tsigkey.cc', + 'tsigkey.h', + 'tsigrecord.cc', + 'tsigrecord.h', + 'txt_like.h', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far = [kea_dns_lib] + libs_built_so_far +LIBS_BUILT_SO_FAR = [kea_dns_lib] + LIBS_BUILT_SO_FAR subdir('tests') diff --git a/src/lib/dns/tests/meson.build b/src/lib/dns/tests/meson.build index 9b4c8e8f36..980220911b 100644 --- a/src/lib/dns/tests/meson.build +++ b/src/lib/dns/tests/meson.build @@ -1,54 +1,55 @@ -kea_dns_tests_exe = executable('kea-dns-tests', - 'dns_exceptions_unittest.cc', - 'edns_unittest.cc', - 'labelsequence_unittest.cc', - 'master_lexer_inputsource_unittest.cc', - 'master_lexer_state_unittest.cc', - 'master_lexer_token_unittest.cc', - 'master_lexer_unittest.cc', - 'master_loader_callbacks_test.cc', - 'master_loader_unittest.cc', - 'messagerenderer_unittest.cc', - 'message_unittest.cc', - 'name_unittest.cc', - 'opcode_unittest.cc', - 'question_unittest.cc', - 'rcode_unittest.cc', - 'rdata_char_string_data_unittest.cc', - 'rdata_char_string_unittest.cc', - 'rdata_dhcid_unittest.cc', - 'rdata_in_aaaa_unittest.cc', - 'rdata_in_a_unittest.cc', - 'rdata_ns_unittest.cc', - 'rdata_opt_unittest.cc', - 'rdata_ptr_unittest.cc', - 'rdata_rrsig_unittest.cc', - 'rdata_soa_unittest.cc', - 'rdata_tkey_unittest.cc', - 'rdata_tsig_unittest.cc', - 'rdata_txt_like_unittest.cc', - 'rdata_unittest.cc', - 'rdata_unittest.h', - 'rrclass_unittest.cc', - 'rrparamregistry_unittest.cc', - 'rrset_unittest.cc', - 'rrttl_unittest.cc', - 'rrtype_unittest.cc', - 'run_unittests.cc', - 'serial_unittest.cc', - 'time_utils_unittest.cc', - 'tsigerror_unittest.cc', - 'tsigkey_unittest.cc', - 'tsigrecord_unittest.cc', - 'tsig_unittest.cc', - 'unittest_util.cc', - 'unittest_util.h', - cpp_args: [ - '-DTEST_DATA_BUILDDIR="@0@/testdata"'.format(meson.current_build_dir()), - '-DTEST_DATA_SRCDIR="@0@/testdata"'.format(meson.current_source_dir()), - ], - dependencies: [gtest], - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far + [kea_util_unittests_lib], +kea_dns_tests = executable( + 'kea-dns-tests', + 'dns_exceptions_unittest.cc', + 'edns_unittest.cc', + 'labelsequence_unittest.cc', + 'master_lexer_inputsource_unittest.cc', + 'master_lexer_state_unittest.cc', + 'master_lexer_token_unittest.cc', + 'master_lexer_unittest.cc', + 'master_loader_callbacks_test.cc', + 'master_loader_unittest.cc', + 'messagerenderer_unittest.cc', + 'message_unittest.cc', + 'name_unittest.cc', + 'opcode_unittest.cc', + 'question_unittest.cc', + 'rcode_unittest.cc', + 'rdata_char_string_data_unittest.cc', + 'rdata_char_string_unittest.cc', + 'rdata_dhcid_unittest.cc', + 'rdata_in_aaaa_unittest.cc', + 'rdata_in_a_unittest.cc', + 'rdata_ns_unittest.cc', + 'rdata_opt_unittest.cc', + 'rdata_ptr_unittest.cc', + 'rdata_rrsig_unittest.cc', + 'rdata_soa_unittest.cc', + 'rdata_tkey_unittest.cc', + 'rdata_tsig_unittest.cc', + 'rdata_txt_like_unittest.cc', + 'rdata_unittest.cc', + 'rdata_unittest.h', + 'rrclass_unittest.cc', + 'rrparamregistry_unittest.cc', + 'rrset_unittest.cc', + 'rrttl_unittest.cc', + 'rrtype_unittest.cc', + 'run_unittests.cc', + 'serial_unittest.cc', + 'time_utils_unittest.cc', + 'tsigerror_unittest.cc', + 'tsigkey_unittest.cc', + 'tsigrecord_unittest.cc', + 'tsig_unittest.cc', + 'unittest_util.cc', + 'unittest_util.h', + cpp_args: [ + 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], + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR + [kea_util_unittests_lib], ) -test('kea_dns_tests_exe', kea_dns_tests_exe) +test('kea_dns_tests', kea_dns_tests, protocol: 'gtest') diff --git a/src/lib/eval/meson.build b/src/lib/eval/meson.build index d0b62250ac..d24d5fae19 100644 --- a/src/lib/eval/meson.build +++ b/src/lib/eval/meson.build @@ -1,24 +1,25 @@ -kea_eval_lib = library('kea-eval', - 'dependency.cc', - 'dependency.h', - 'evaluate.cc', - 'evaluate.h', - 'eval_context.cc', - 'eval_context.h', - 'eval_context_decl.h', - 'eval_log.cc', - 'eval_log.h', - 'eval_messages.cc', - 'eval_messages.h', - 'lexer.cc', - 'parser.cc', - 'parser.h', - 'token.cc', - 'token.h', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_eval_lib = library( + 'kea-eval', + 'dependency.cc', + 'dependency.h', + 'evaluate.cc', + 'evaluate.h', + 'eval_context.cc', + 'eval_context.h', + 'eval_context_decl.h', + 'eval_log.cc', + 'eval_log.h', + 'eval_messages.cc', + 'eval_messages.h', + 'lexer.cc', + 'parser.cc', + 'parser.h', + 'token.cc', + 'token.h', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far = [kea_eval_lib] + libs_built_so_far +LIBS_BUILT_SO_FAR = [kea_eval_lib] + LIBS_BUILT_SO_FAR subdir('tests') diff --git a/src/lib/eval/tests/meson.build b/src/lib/eval/tests/meson.build index 054a2e7429..42b7d9c3c5 100644 --- a/src/lib/eval/tests/meson.build +++ b/src/lib/eval/tests/meson.build @@ -1,12 +1,13 @@ -kea_eval_tests_exe = executable('kea-eval-tests', - 'boolean_unittest.cc', - 'context_unittest.cc', - 'dependency_unittest.cc', - 'evaluate_unittest.cc', - 'run_unittests.cc', - 'token_unittest.cc', - dependencies: [gtest], - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far + [kea_testutils_lib, kea_util_unittests_lib], +kea_eval_tests = executable( + 'kea-eval-tests', + 'boolean_unittest.cc', + 'context_unittest.cc', + 'dependency_unittest.cc', + 'evaluate_unittest.cc', + 'run_unittests.cc', + 'token_unittest.cc', + dependencies: [gtest], + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR + [kea_testutils_lib, kea_util_unittests_lib], ) -test('kea_eval_tests_exe', kea_eval_tests_exe) +test('kea_eval_tests', kea_eval_tests, protocol: 'gtest') diff --git a/src/lib/exceptions/meson.build b/src/lib/exceptions/meson.build index 3594c23534..48545739c0 100644 --- a/src/lib/exceptions/meson.build +++ b/src/lib/exceptions/meson.build @@ -1,11 +1,12 @@ -kea_exceptions_lib = library('kea-exceptions', - 'exceptions.cc', - 'exceptions.h', - 'isc_assert.h', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_exceptions_lib = library( + 'kea-exceptions', + 'exceptions.cc', + 'exceptions.h', + 'isc_assert.h', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far = [kea_exceptions_lib] + libs_built_so_far +LIBS_BUILT_SO_FAR = [kea_exceptions_lib] + LIBS_BUILT_SO_FAR subdir('tests') diff --git a/src/lib/exceptions/tests/meson.build b/src/lib/exceptions/tests/meson.build index 2b5f41ea39..6bdcceb907 100644 --- a/src/lib/exceptions/tests/meson.build +++ b/src/lib/exceptions/tests/meson.build @@ -1,8 +1,9 @@ -kea_exceptions_tests_exe = executable('kea-exceptions-tests', - 'exceptions_unittest.cc', - 'run_unittests.cc', - dependencies: [gtest], - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far, +kea_exceptions_tests = executable( + 'kea-exceptions-tests', + 'exceptions_unittest.cc', + 'run_unittests.cc', + dependencies: [gtest], + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR, ) -test('kea_exceptions_tests_exe', kea_exceptions_tests_exe) +test('kea_exceptions_tests', kea_exceptions_tests, protocol: 'gtest') diff --git a/src/lib/hooks/meson.build b/src/lib/hooks/meson.build index 436a077e51..e4cbe77ee1 100644 --- a/src/lib/hooks/meson.build +++ b/src/lib/hooks/meson.build @@ -1,37 +1,38 @@ -kea_hooks_lib = library('kea-hooks', - 'callout_handle.cc', - 'callout_handle.h', - 'callout_handle_associate.cc', - 'callout_handle_associate.h', - 'callout_manager.cc', - 'callout_manager.h', - 'hooks.h', - 'hooks_config.cc', - 'hooks_config.h', - 'hooks_log.cc', - 'hooks_log.h', - 'hooks_manager.cc', - 'hooks_manager.h', - 'hooks_messages.cc', - 'hooks_messages.h', - 'hooks_parser.cc', - 'hooks_parser.h', - 'libinfo.cc', - 'libinfo.h', - 'library_handle.cc', - 'library_handle.h', - 'library_manager.cc', - 'library_manager.h', - 'library_manager_collection.cc', - 'library_manager_collection.h', - 'parking_lots.h', - 'pointer_converter.h', - 'server_hooks.cc', - 'server_hooks.h', - cpp_args: ['-DDEFAULT_HOOKS_PATH="@0@"'.format(meson.current_build_dir())], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_hooks_lib = library( + 'kea-hooks', + 'callout_handle.cc', + 'callout_handle.h', + 'callout_handle_associate.cc', + 'callout_handle_associate.h', + 'callout_manager.cc', + 'callout_manager.h', + 'hooks.h', + 'hooks_config.cc', + 'hooks_config.h', + 'hooks_log.cc', + 'hooks_log.h', + 'hooks_manager.cc', + 'hooks_manager.h', + 'hooks_messages.cc', + 'hooks_messages.h', + 'hooks_parser.cc', + 'hooks_parser.h', + 'libinfo.cc', + 'libinfo.h', + 'library_handle.cc', + 'library_handle.h', + 'library_manager.cc', + 'library_manager.h', + 'library_manager_collection.cc', + 'library_manager_collection.h', + 'parking_lots.h', + 'pointer_converter.h', + 'server_hooks.cc', + 'server_hooks.h', + cpp_args: [f'-DDEFAULT_HOOKS_PATH="@TOP_BUILD_DIR@"'], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far += [kea_hooks_lib] +LIBS_BUILT_SO_FAR = [kea_hooks_lib] + LIBS_BUILT_SO_FAR diff --git a/src/lib/http/meson.build b/src/lib/http/meson.build index ee94a2fcda..24296959da 100644 --- a/src/lib/http/meson.build +++ b/src/lib/http/meson.build @@ -1,65 +1,66 @@ -kea_http_lib = library('kea-http', - 'auth_config.h', - 'auth_log.cc', - 'auth_log.h', - 'auth_messages.cc', - 'auth_messages.h', - 'basic_auth.cc', - 'basic_auth.h', - 'basic_auth_config.cc', - 'basic_auth_config.h', - 'cfg_http_header.cc', - 'cfg_http_header.h', - 'client.cc', - 'client.h', - 'connection.cc', - 'connection.h', - 'connection_pool.cc', - 'connection_pool.h', - 'date_time.cc', - 'date_time.h', - 'header_context.h', - 'http_acceptor.h', - 'http_header.cc', - 'http_header.h', - 'http_log.cc', - 'http_log.h', - 'http_message.cc', - 'http_message.h', - 'http_messages.cc', - 'http_messages.h', - 'http_message_parser_base.cc', - 'http_message_parser_base.h', - 'http_types.h', - 'listener.cc', - 'listener.h', - 'listener_impl.cc', - 'listener_impl.h', - 'post_request.cc', - 'post_request.h', - 'post_request_json.cc', - 'post_request_json.h', - 'request.cc', - 'request.h', - 'request_context.h', - 'request_parser.cc', - 'request_parser.h', - 'response.cc', - 'response.h', - 'response_context.h', - 'response_creator.cc', - 'response_creator.h', - 'response_creator_factory.h', - 'response_json.cc', - 'response_json.h', - 'response_parser.cc', - 'response_parser.h', - 'url.cc', - 'url.h', - dependencies: [crypto], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_http_lib = library( + 'kea-http', + 'auth_config.h', + 'auth_log.cc', + 'auth_log.h', + 'auth_messages.cc', + 'auth_messages.h', + 'basic_auth.cc', + 'basic_auth.h', + 'basic_auth_config.cc', + 'basic_auth_config.h', + 'cfg_http_header.cc', + 'cfg_http_header.h', + 'client.cc', + 'client.h', + 'connection.cc', + 'connection.h', + 'connection_pool.cc', + 'connection_pool.h', + 'date_time.cc', + 'date_time.h', + 'header_context.h', + 'http_acceptor.h', + 'http_header.cc', + 'http_header.h', + 'http_log.cc', + 'http_log.h', + 'http_message.cc', + 'http_message.h', + 'http_messages.cc', + 'http_messages.h', + 'http_message_parser_base.cc', + 'http_message_parser_base.h', + 'http_types.h', + 'listener.cc', + 'listener.h', + 'listener_impl.cc', + 'listener_impl.h', + 'post_request.cc', + 'post_request.h', + 'post_request_json.cc', + 'post_request_json.h', + 'request.cc', + 'request.h', + 'request_context.h', + 'request_parser.cc', + 'request_parser.h', + 'response.cc', + 'response.h', + 'response_context.h', + 'response_creator.cc', + 'response_creator.h', + 'response_creator_factory.h', + 'response_json.cc', + 'response_json.h', + 'response_parser.cc', + 'response_parser.h', + 'url.cc', + 'url.h', + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far += [kea_http_lib] +LIBS_BUILT_SO_FAR = [kea_http_lib] + LIBS_BUILT_SO_FAR diff --git a/src/lib/log/compiler/meson.build b/src/lib/log/compiler/meson.build index 86057d3a39..948de14190 100644 --- a/src/lib/log/compiler/meson.build +++ b/src/lib/log/compiler/meson.build @@ -1,8 +1,5 @@ -sources = [ - 'message.cc'] - -kea_msg_compiler = executable('kea-msg-compiler', - sources, - include_directories: [include_directories('.')] + includes, - link_with : [exceptions_lib, log_lib, util_lib], - install : true) +executable('kea-msg-compiler', + 'message.cc', + include_directories: [include_directories('.')] + INCLUDES, + link_with : LIBS_BUILT_SO_FAR, + install : true) diff --git a/src/lib/log/interprocess/meson.build b/src/lib/log/interprocess/meson.build index 7af3d6c144..4106038820 100644 --- a/src/lib/log/interprocess/meson.build +++ b/src/lib/log/interprocess/meson.build @@ -1,13 +1,14 @@ -kea_log_interprocess_lib = library('kea-log-interprocess', - 'interprocess_sync.h', - 'interprocess_sync_file.cc', - 'interprocess_sync_file.h', - 'interprocess_sync_null.cc', - 'interprocess_sync_null.h', - cpp_args: ['-DLOCKFILE_DIR="@0@"'.format(meson.current_build_dir())], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_log_interprocess_lib = library( + 'kea-log-interprocess', + 'interprocess_sync.h', + 'interprocess_sync_file.cc', + 'interprocess_sync_file.h', + 'interprocess_sync_null.cc', + 'interprocess_sync_null.h', + cpp_args: [f'-DLOCKFILE_DIR="@TOP_BUILD_DIR@"'], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far = [kea_log_interprocess_lib] + libs_built_so_far +LIBS_BUILT_SO_FAR = [kea_log_interprocess_lib] + LIBS_BUILT_SO_FAR diff --git a/src/lib/log/meson.build b/src/lib/log/meson.build index 33b835ea30..ee38b6ef01 100644 --- a/src/lib/log/meson.build +++ b/src/lib/log/meson.build @@ -1,51 +1,52 @@ subdir('interprocess') -kea_log_lib = library('kea-log', - 'buffer_appender_impl.cc', - 'buffer_appender_impl.h', - 'logger.cc', - 'logger.h', - 'logger_impl.cc', - 'logger_impl.h', - 'logger_level.cc', - 'logger_level.h', - 'logger_level_impl.cc', - 'logger_level_impl.h', - 'logger_manager.cc', - 'logger_manager.h', - 'logger_manager_impl.cc', - 'logger_manager_impl.h', - 'logger_name.cc', - 'logger_name.h', - 'logger_specification.h', - 'logger_support.cc', - 'logger_support.h', - 'logger_unittest_support.cc', - 'logger_unittest_support.h', - 'logimpl_messages.cc', - 'logimpl_messages.h', - 'log_dbglevels.cc', - 'log_dbglevels.h', - 'log_formatter.cc', - 'log_formatter.h', - 'log_messages.cc', - 'log_messages.h', - 'macros.h', - 'message_dictionary.cc', - 'message_dictionary.h', - 'message_exception.h', - 'message_initializer.cc', - 'message_initializer.h', - 'message_reader.cc', - 'message_reader.h', - 'message_types.h', - 'output_option.cc', - 'output_option.h', - cpp_args: ['-DTOP_BUILDDIR="@0@"'.format(meson.project_build_root())], - dependencies: [log4cplus], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_log_lib = library( + 'kea-log', + 'buffer_appender_impl.cc', + 'buffer_appender_impl.h', + 'logger.cc', + 'logger.h', + 'logger_impl.cc', + 'logger_impl.h', + 'logger_level.cc', + 'logger_level.h', + 'logger_level_impl.cc', + 'logger_level_impl.h', + 'logger_manager.cc', + 'logger_manager.h', + 'logger_manager_impl.cc', + 'logger_manager_impl.h', + 'logger_name.cc', + 'logger_name.h', + 'logger_specification.h', + 'logger_support.cc', + 'logger_support.h', + 'logger_unittest_support.cc', + 'logger_unittest_support.h', + 'logimpl_messages.cc', + 'logimpl_messages.h', + 'log_dbglevels.cc', + 'log_dbglevels.h', + 'log_formatter.cc', + 'log_formatter.h', + 'log_messages.cc', + 'log_messages.h', + 'macros.h', + 'message_dictionary.cc', + 'message_dictionary.h', + 'message_exception.h', + 'message_initializer.cc', + 'message_initializer.h', + 'message_reader.cc', + 'message_reader.h', + 'message_types.h', + 'output_option.cc', + 'output_option.h', + cpp_args: [f'-DTOP_BUILDDIR="@TOP_BUILD_DIR@"'], + dependencies: [log4cplus], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far = [kea_log_lib] + libs_built_so_far +LIBS_BUILT_SO_FAR = [kea_log_lib] + LIBS_BUILT_SO_FAR subdir('tests') diff --git a/src/lib/log/tests/Makefile.am b/src/lib/log/tests/Makefile.am index cfa9280430..3abb45725a 100644 --- a/src/lib/log/tests/Makefile.am +++ b/src/lib/log/tests/Makefile.am @@ -2,6 +2,7 @@ SUBDIRS = . # Define the flags used in each set of tests. AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib +AM_CPPFLAGS += -DTEMP_DIR=\"${build_dir}\" AM_CPPFLAGS += $(BOOST_INCLUDES) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES) AM_CXXFLAGS = $(KEA_CXXFLAGS) diff --git a/src/lib/log/tests/meson.build b/src/lib/log/tests/meson.build index 235dd6af38..1c79ef6fbc 100644 --- a/src/lib/log/tests/meson.build +++ b/src/lib/log/tests/meson.build @@ -1,22 +1,23 @@ -kea_log_tests_exe = executable('kea-log-tests', - 'buffer_appender_unittest.cc', - 'logger_level_impl_unittest.cc', - 'logger_level_unittest.cc', - 'logger_manager_unittest.cc', - 'logger_name_unittest.cc', - 'logger_specification_unittest.cc', - 'logger_support_unittest.cc', - 'logger_unittest.cc', - 'log_formatter_unittest.cc', - 'log_test_messages.cc', - 'log_test_messages.h', - 'message_dictionary_unittest.cc', - 'message_reader_unittest.cc', - 'output_option_unittest.cc', - 'run_unittests.cc', - cpp_args: ['-DTEMP_DIR="@0@"'.format(meson.current_build_dir())], - dependencies: [gtest, log4cplus], - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far + [kea_util_unittests_lib], +kea_log_tests = executable( + 'kea-log-tests', + 'buffer_appender_unittest.cc', + 'logger_level_impl_unittest.cc', + 'logger_level_unittest.cc', + 'logger_manager_unittest.cc', + 'logger_name_unittest.cc', + 'logger_specification_unittest.cc', + 'logger_support_unittest.cc', + 'logger_unittest.cc', + 'log_formatter_unittest.cc', + 'log_test_messages.cc', + 'log_test_messages.h', + 'message_dictionary_unittest.cc', + 'message_reader_unittest.cc', + 'output_option_unittest.cc', + 'run_unittests.cc', + cpp_args: [f'-DTEMP_DIR="@TOP_BUILD_DIR@"'], + dependencies: [gtest, log4cplus], + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR + [kea_util_unittests_lib], ) -test('kea_log_tests_exe', kea_log_tests_exe) +test('kea_log_tests', kea_log_tests, protocol: 'gtest') diff --git a/src/lib/log/tests/tempdir.h.in b/src/lib/log/tests/tempdir.h.in deleted file mode 100644 index c805844967..0000000000 --- a/src/lib/log/tests/tempdir.h.in +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC") -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef TEMPDIR_H -#define TEMPDIR_H - -/// \brief Define temporary directory -/// -/// Defines the temporary directory in which temporary files used by the -/// unit tests are created. - -#include - -namespace { -std::string TEMP_DIR("@builddir@"); -} - -#endif // TEMPDIR_H diff --git a/src/lib/mysql/meson.build b/src/lib/mysql/meson.build index 52cc8bf172..ae722cf76e 100644 --- a/src/lib/mysql/meson.build +++ b/src/lib/mysql/meson.build @@ -1,18 +1,19 @@ if not mysql.found() - subdir_done() + subdir_done() endif -kea_mysql_lib = library('kea-mysql', - 'mysql_binding.cc', - 'mysql_binding.h', - 'mysql_connection.cc', - 'mysql_connection.h', - 'mysql_constants.h', - cpp_args: [f'-DKEA_ADMIN="@kea_admin@"'], - dependencies: [mysql], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_mysql_lib = library( + 'kea-mysql', + 'mysql_binding.cc', + 'mysql_binding.h', + 'mysql_connection.cc', + 'mysql_connection.h', + 'mysql_constants.h', + cpp_args: [f'-DKEA_ADMIN="@KEA_ADMIN@"'], + dependencies: [mysql], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far += [kea_mysql_lib] +LIBS_BUILT_SO_FAR = [kea_mysql_lib] + LIBS_BUILT_SO_FAR diff --git a/src/lib/pgsql/meson.build b/src/lib/pgsql/meson.build index bb5e92c0e5..e4575d4ff5 100644 --- a/src/lib/pgsql/meson.build +++ b/src/lib/pgsql/meson.build @@ -1,17 +1,18 @@ -if not postgresql.found() - subdir_done() +if not postgresql.found() or not postgresql_server_header.found() + subdir_done() endif -kea_pgsql_lib = library('kea-pgsql', - 'pgsql_connection.cc', - 'pgsql_connection.h', - 'pgsql_exchange.cc', - 'pgsql_exchange.h', - cpp_args: [f'-DKEA_ADMIN="@kea_admin@"'], - dependencies: [postgresql], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_pgsql_lib = library( + 'kea-pgsql', + 'pgsql_connection.cc', + 'pgsql_connection.h', + 'pgsql_exchange.cc', + 'pgsql_exchange.h', + cpp_args: [f'-DKEA_ADMIN="@KEA_ADMIN@"'], + dependencies: [postgresql, postgresql_server_header], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far += [kea_pgsql_lib] +LIBS_BUILT_SO_FAR = [kea_pgsql_lib] + LIBS_BUILT_SO_FAR diff --git a/src/lib/process/cfgrpt/config_report.cc b/src/lib/process/cfgrpt/config_report.cc.in similarity index 100% rename from src/lib/process/cfgrpt/config_report.cc rename to src/lib/process/cfgrpt/config_report.cc.in diff --git a/src/lib/process/cfgrpt/meson.build b/src/lib/process/cfgrpt/meson.build index c2ccf55318..5052cf57a1 100644 --- a/src/lib/process/cfgrpt/meson.build +++ b/src/lib/process/cfgrpt/meson.build @@ -1,10 +1,17 @@ -kea_cfgrpt_lib = library('kea-cfgrpt', - 'cfgrpt.cc', - 'config_report.cc', - 'config_report.h', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +config_report_cc = configure_file( + input: 'config_report.cc.in', + output: 'config_report.cc', + configuration: conf_data, ) -libs_built_so_far = [kea_cfgrpt_lib] + libs_built_so_far + +kea_cfgrpt_lib = library( + 'kea-cfgrpt', + 'cfgrpt.cc', + config_report_cc, + 'config_report.h', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, +) +LIBS_BUILT_SO_FAR = [kea_cfgrpt_lib] + LIBS_BUILT_SO_FAR diff --git a/src/lib/process/meson.build b/src/lib/process/meson.build index 5c4289fe44..8aa9124c58 100644 --- a/src/lib/process/meson.build +++ b/src/lib/process/meson.build @@ -1,33 +1,34 @@ subdir('cfgrpt') -kea_process_lib = library('kea-process', - 'cb_ctl_base.h', - 'config_base.cc', - 'config_base.h', - 'config_ctl_info.cc', - 'config_ctl_info.h', - 'config_ctl_parser.cc', - 'config_ctl_parser.h', - 'daemon.cc', - 'daemon.h', - 'd_cfg_mgr.cc', - 'd_cfg_mgr.h', - 'd_controller.cc', - 'd_controller.h', - 'd_log.cc', - 'd_log.h', - 'd_process.h', - 'logging_info.cc', - 'logging_info.h', - 'log_parser.cc', - 'log_parser.h', - 'process_messages.cc', - 'process_messages.h', - 'redact_config.cc', - 'redact_config.h', - cpp_args: ['-DDATA_DIR="@0@"'.format(meson.current_build_dir())], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_process_lib = library( + 'kea-process', + 'cb_ctl_base.h', + 'config_base.cc', + 'config_base.h', + 'config_ctl_info.cc', + 'config_ctl_info.h', + 'config_ctl_parser.cc', + 'config_ctl_parser.h', + 'daemon.cc', + 'daemon.h', + 'd_cfg_mgr.cc', + 'd_cfg_mgr.h', + 'd_controller.cc', + 'd_controller.h', + 'd_log.cc', + 'd_log.h', + 'd_process.h', + 'logging_info.cc', + 'logging_info.h', + 'log_parser.cc', + 'log_parser.h', + 'process_messages.cc', + 'process_messages.h', + 'redact_config.cc', + 'redact_config.h', + cpp_args: [f'-DDATA_DIR="@TOP_BUILD_DIR@"'], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far += [kea_process_lib] +LIBS_BUILT_SO_FAR = [kea_process_lib] + LIBS_BUILT_SO_FAR diff --git a/src/lib/stats/meson.build b/src/lib/stats/meson.build index 2cca416af2..51b7f47c38 100644 --- a/src/lib/stats/meson.build +++ b/src/lib/stats/meson.build @@ -1,14 +1,15 @@ -kea_stats_lib = library('kea-stats', - 'context.cc', - 'context.h', - 'observation.cc', - 'observation.h', - 'stats_mgr.cc', - 'stats_mgr.h', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_stats_lib = library( + 'kea-stats', + 'context.cc', + 'context.h', + 'observation.cc', + 'observation.h', + 'stats_mgr.cc', + 'stats_mgr.h', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far = [kea_stats_lib] + libs_built_so_far +LIBS_BUILT_SO_FAR = [kea_stats_lib] + LIBS_BUILT_SO_FAR subdir('tests') diff --git a/src/lib/stats/tests/meson.build b/src/lib/stats/tests/meson.build index 51367fe127..6bb1bbcd16 100644 --- a/src/lib/stats/tests/meson.build +++ b/src/lib/stats/tests/meson.build @@ -1,10 +1,11 @@ -kea_stats_tests_exe = executable('kea-stats-tests', - 'context_unittest.cc', - 'observation_unittest.cc', - 'run_unittests.cc', - 'stats_mgr_unittest.cc', - dependencies: [gtest], - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far + [kea_testutils_lib, kea_util_unittests_lib], +kea_stats_tests = executable( + 'kea-stats-tests', + 'context_unittest.cc', + 'observation_unittest.cc', + 'run_unittests.cc', + 'stats_mgr_unittest.cc', + dependencies: [gtest], + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR + [kea_testutils_lib, kea_util_unittests_lib], ) -test('kea_stats_tests_exe', kea_stats_tests_exe) +test('kea_stats_tests', kea_stats_tests, protocol: 'gtest') diff --git a/src/lib/tcp/meson.build b/src/lib/tcp/meson.build index a397bbf9d9..38bd10f242 100644 --- a/src/lib/tcp/meson.build +++ b/src/lib/tcp/meson.build @@ -1,23 +1,24 @@ -kea_tcp_lib = library('kea-tcp', - 'mt_tcp_listener_mgr.cc', - 'mt_tcp_listener_mgr.h', - 'tcp_connection.cc', - 'tcp_connection.h', - 'tcp_connection_acceptor.h', - 'tcp_connection_pool.cc', - 'tcp_connection_pool.h', - 'tcp_listener.cc', - 'tcp_listener.h', - 'tcp_log.cc', - 'tcp_log.h', - 'tcp_messages.cc', - 'tcp_messages.h', - 'tcp_stream_msg.cc', - 'tcp_stream_msg.h', - dependencies: [crypto], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_tcp_lib = library( + 'kea-tcp', + 'mt_tcp_listener_mgr.cc', + 'mt_tcp_listener_mgr.h', + 'tcp_connection.cc', + 'tcp_connection.h', + 'tcp_connection_acceptor.h', + 'tcp_connection_pool.cc', + 'tcp_connection_pool.h', + 'tcp_listener.cc', + 'tcp_listener.h', + 'tcp_log.cc', + 'tcp_log.h', + 'tcp_messages.cc', + 'tcp_messages.h', + 'tcp_stream_msg.cc', + 'tcp_stream_msg.h', + dependencies: [crypto], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far += [kea_tcp_lib] +LIBS_BUILT_SO_FAR = [kea_tcp_lib] + LIBS_BUILT_SO_FAR diff --git a/src/lib/testutils/meson.build b/src/lib/testutils/meson.build index 78cf154e05..6d7ba30939 100644 --- a/src/lib/testutils/meson.build +++ b/src/lib/testutils/meson.build @@ -1,22 +1,23 @@ -kea_testutils_lib = library('kea-testutils', - 'gtest_utils.h', - 'io_utils.cc', - 'io_utils.h', - 'log_utils.cc', - 'log_utils.h', - 'multi_threading_utils.h', - 'sandbox.h', - 'test_to_element.cc', - 'test_to_element.h', - 'threaded_test.cc', - 'threaded_test.h', - 'unix_control_client.cc', - 'unix_control_client.h', - 'user_context_utils.cc', - 'user_context_utils.h', - dependencies: [gtest], - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_testutils_lib = library( + 'kea-testutils', + 'gtest_utils.h', + 'io_utils.cc', + 'io_utils.h', + 'log_utils.cc', + 'log_utils.h', + 'multi_threading_utils.h', + 'sandbox.h', + 'test_to_element.cc', + 'test_to_element.h', + 'threaded_test.cc', + 'threaded_test.h', + 'unix_control_client.cc', + 'unix_control_client.h', + 'user_context_utils.cc', + 'user_context_utils.h', + dependencies: [gtest], + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/util/io/meson.build b/src/lib/util/io/meson.build index c02702a3d6..7d89dba876 100644 --- a/src/lib/util/io/meson.build +++ b/src/lib/util/io/meson.build @@ -1,9 +1,10 @@ -kea_util_io_lib = library('kea-util-io', - 'fd.cc', - 'fd.h', - 'pktinfo_utilities.h', - 'sockaddr_util.h', - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far, +kea_util_io_lib = library( + 'kea-util-io', + 'fd.cc', + 'fd.h', + 'pktinfo_utilities.h', + 'sockaddr_util.h', + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR, ) -libs_built_so_far = [kea_util_io_lib] + libs_built_so_far +LIBS_BUILT_SO_FAR = [kea_util_io_lib] + LIBS_BUILT_SO_FAR diff --git a/src/lib/util/meson.build b/src/lib/util/meson.build index b833045c98..1e817895a9 100644 --- a/src/lib/util/meson.build +++ b/src/lib/util/meson.build @@ -1,62 +1,63 @@ -kea_util_lib = library('kea-util', - 'bigints.h', - 'boost_time_utils.cc', - 'boost_time_utils.h', - 'buffer.h', - 'chrono_time_utils.cc', - 'chrono_time_utils.h', - 'csv_file.cc', - 'csv_file.h', - 'dhcp_space.cc', - 'dhcp_space.h', - 'doubles.h', - 'encode/encode.cc', - 'encode/encode.h', - 'encode/utf8.cc', - 'encode/utf8.h', - 'filesystem.cc', - 'filesystem.h', - 'hash.h', - 'io.h', - 'labeled_value.cc', - 'labeled_value.h', - 'memory_segment.h', - 'memory_segment_local.cc', - 'memory_segment_local.h', - 'multi_threading_mgr.cc', - 'multi_threading_mgr.h', - 'optional.h', - 'pid_file.cc', - 'pid_file.h', - 'pointer_util.h', - 'range_utilities.h', - 'readwrite_mutex.h', - 'reconnect_ctl.cc', - 'reconnect_ctl.h', - 'staged_value.h', - 'state_model.cc', - 'state_model.h', - 'stopwatch.cc', - 'stopwatch.h', - 'stopwatch_impl.cc', - 'stopwatch_impl.h', - 'str.cc', - 'str.h', - 'thread_pool.h', - 'triplet.h', - 'unlock_guard.h', - 'versioned_csv_file.cc', - 'versioned_csv_file.h', - 'watched_thread.cc', - 'watched_thread.h', - 'watch_socket.cc', - 'watch_socket.h', - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: kea_exceptions_lib, +kea_util_lib = library( + 'kea-util', + 'bigints.h', + 'boost_time_utils.cc', + 'boost_time_utils.h', + 'buffer.h', + 'chrono_time_utils.cc', + 'chrono_time_utils.h', + 'csv_file.cc', + 'csv_file.h', + 'dhcp_space.cc', + 'dhcp_space.h', + 'doubles.h', + 'encode/encode.cc', + 'encode/encode.h', + 'encode/utf8.cc', + 'encode/utf8.h', + 'filesystem.cc', + 'filesystem.h', + 'hash.h', + 'io.h', + 'labeled_value.cc', + 'labeled_value.h', + 'memory_segment.h', + 'memory_segment_local.cc', + 'memory_segment_local.h', + 'multi_threading_mgr.cc', + 'multi_threading_mgr.h', + 'optional.h', + 'pid_file.cc', + 'pid_file.h', + 'pointer_util.h', + 'range_utilities.h', + 'readwrite_mutex.h', + 'reconnect_ctl.cc', + 'reconnect_ctl.h', + 'staged_value.h', + 'state_model.cc', + 'state_model.h', + 'stopwatch.cc', + 'stopwatch.h', + 'stopwatch_impl.cc', + 'stopwatch_impl.h', + 'str.cc', + 'str.h', + 'thread_pool.h', + 'triplet.h', + 'unlock_guard.h', + 'versioned_csv_file.cc', + 'versioned_csv_file.h', + 'watched_thread.cc', + 'watched_thread.h', + 'watch_socket.cc', + 'watch_socket.h', + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, ) subdir('io') subdir('unittests') -libs_built_so_far = [kea_util_lib] + libs_built_so_far +LIBS_BUILT_SO_FAR = [kea_util_lib] + LIBS_BUILT_SO_FAR subdir('tests') diff --git a/src/lib/util/tests/meson.build b/src/lib/util/tests/meson.build index 43e46d06d5..d099387ab0 100755 --- a/src/lib/util/tests/meson.build +++ b/src/lib/util/tests/meson.build @@ -1,40 +1,44 @@ -kea_util_tests_exe = executable('kea-util-tests', - 'bigint_unittest.cc', - 'boost_time_utils_unittest.cc', - 'buffer_unittest.cc', - 'chrono_time_utils_unittest.cc', - 'csv_file_unittest.cc', - 'dhcp_space_unittest.cc', - 'doubles_unittest.cc', - 'encode_unittest.cc', - 'fd_tests.cc', - 'filesystem_unittests.cc', - 'hash_unittest.cc', - 'io_unittests.cc', - 'labeled_value_unittest.cc', - 'memory_segment_common_unittest.cc', - 'memory_segment_common_unittest.h', - 'memory_segment_local_unittest.cc', - 'multi_threading_mgr_unittest.cc', - 'optional_unittest.cc', - 'pid_file_unittest.cc', - 'range_utilities_unittest.cc', - 'readwrite_mutex_unittest.cc', - 'run_unittests.cc', - 'staged_value_unittest.cc', - 'state_model_unittest.cc', - 'stopwatch_unittest.cc', - 'str_unittests.cc', - 'thread_pool_unittest.cc', - 'triplet_unittest.cc', - 'unlock_guard_unittests.cc', - 'utf8_unittest.cc', - 'versioned_csv_file_unittest.cc', - 'watched_thread_unittest.cc', - 'watch_socket_unittests.cc', - cpp_args: ['-DABS_SRCDIR="@0@"'.format(meson.current_source_dir()), '-DTEST_DATA_BUILDDIR="@0@"'.format(meson.current_build_dir())], - dependencies: [gtest], - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far + [kea_util_unittests_lib], +kea_util_tests = executable( + 'kea-util-tests', + 'bigint_unittest.cc', + 'boost_time_utils_unittest.cc', + 'buffer_unittest.cc', + 'chrono_time_utils_unittest.cc', + 'csv_file_unittest.cc', + 'dhcp_space_unittest.cc', + 'doubles_unittest.cc', + 'encode_unittest.cc', + 'fd_tests.cc', + 'filesystem_unittests.cc', + 'hash_unittest.cc', + 'io_unittests.cc', + 'labeled_value_unittest.cc', + 'memory_segment_common_unittest.cc', + 'memory_segment_common_unittest.h', + 'memory_segment_local_unittest.cc', + 'multi_threading_mgr_unittest.cc', + 'optional_unittest.cc', + 'pid_file_unittest.cc', + 'range_utilities_unittest.cc', + 'readwrite_mutex_unittest.cc', + 'run_unittests.cc', + 'staged_value_unittest.cc', + 'state_model_unittest.cc', + 'stopwatch_unittest.cc', + 'str_unittests.cc', + 'thread_pool_unittest.cc', + 'triplet_unittest.cc', + 'unlock_guard_unittests.cc', + 'utf8_unittest.cc', + 'versioned_csv_file_unittest.cc', + 'watched_thread_unittest.cc', + 'watch_socket_unittests.cc', + cpp_args: [ + f'-DABS_SRCDIR="@TOP_SOURCE_DIR@/src/lib/util/tests"', + f'-DTEST_DATA_BUILDDIR="@TOP_BUILD_DIR@/src/lib/util/tests"', + ], + dependencies: [gtest], + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR + [kea_util_unittests_lib], ) -test('kea_util_tests_exe', kea_util_tests_exe) +test('kea_util_tests', kea_util_tests, protocol: 'gtest') diff --git a/src/lib/util/unittests/meson.build b/src/lib/util/unittests/meson.build index b29c733fc7..58ca2df1b7 100644 --- a/src/lib/util/unittests/meson.build +++ b/src/lib/util/unittests/meson.build @@ -1,22 +1,23 @@ -kea_util_unittests_lib = library('kea-util-unittests', - 'check_valgrind.cc', - 'check_valgrind.h', - 'fork.cc', - 'fork.h', - 'interprocess_util.cc', - 'interprocess_util.h', - 'newhook.cc', - 'newhook.h', - 'resource.cc', - 'resource.h', - 'run_all.cc', - 'run_all.h', - 'testdata.cc', - 'testdata.h', - 'textdata.h', - 'wiredata.cc', - 'wiredata.h', - dependencies: [gtest], - include_directories: [include_directories('.')] + includes, - link_with: libs_built_so_far, +kea_util_unittests_lib = library( + 'kea-util-unittests', + 'check_valgrind.cc', + 'check_valgrind.h', + 'fork.cc', + 'fork.h', + 'interprocess_util.cc', + 'interprocess_util.h', + 'newhook.cc', + 'newhook.h', + 'resource.cc', + 'resource.h', + 'run_all.cc', + 'run_all.h', + 'testdata.cc', + 'testdata.h', + 'textdata.h', + 'wiredata.cc', + 'wiredata.h', + dependencies: [gtest], + include_directories: [include_directories('.')] + INCLUDES, + link_with: LIBS_BUILT_SO_FAR, ) diff --git a/src/lib/yang/meson.build b/src/lib/yang/meson.build index de4a32f73d..2948fafade 100644 --- a/src/lib/yang/meson.build +++ b/src/lib/yang/meson.build @@ -1,53 +1,55 @@ if not netconf_deps_found - subdir_done() + subdir_done() endif -kea_yang_lib = library('kea-yang', - 'adaptor.cc', - 'adaptor.h', - 'adaptor_config.cc', - 'adaptor_config.h', - 'adaptor_host.cc', - 'adaptor_host.h', - 'adaptor_option.cc', - 'adaptor_option.h', - 'adaptor_pool.cc', - 'adaptor_pool.h', - 'adaptor_subnet.cc', - 'adaptor_subnet.h', - 'netconf_error.h', - 'translator.cc', - 'translator.h', - 'translator_class.cc', - 'translator_class.h', - 'translator_config.cc', - 'translator_config.h', - 'translator_control_socket.cc', - 'translator_control_socket.h', - 'translator_database.cc', - 'translator_database.h', - 'translator_host.cc', - 'translator_host.h', - 'translator_logger.cc', - 'translator_logger.h', - 'translator_option_data.cc', - 'translator_option_data.h', - 'translator_option_def.cc', - 'translator_option_def.h', - 'translator_pd_pool.cc', - 'translator_pd_pool.h', - 'translator_pool.cc', - 'translator_pool.h', - 'translator_shared_network.cc', - 'translator_shared_network.h', - 'translator_subnet.cc', - 'translator_subnet.h', - 'yang_models.h', - 'yang_revisions.h', - dependencies: netconf_deps_array, - include_directories: [include_directories('.')] + includes, - install: true, - install_dir: 'lib', - link_with: libs_built_so_far, +kea_yang_lib = library( + 'kea-yang', + 'adaptor.cc', + 'adaptor.h', + 'adaptor_config.cc', + 'adaptor_config.h', + 'adaptor_host.cc', + 'adaptor_host.h', + 'adaptor_option.cc', + 'adaptor_option.h', + 'adaptor_pool.cc', + 'adaptor_pool.h', + 'adaptor_subnet.cc', + 'adaptor_subnet.h', + 'netconf_error.h', + 'translator.cc', + 'translator.h', + 'translator_class.cc', + 'translator_class.h', + 'translator_config.cc', + 'translator_config.h', + 'translator_control_socket.cc', + 'translator_control_socket.h', + 'translator_database.cc', + 'translator_database.h', + 'translator_host.cc', + 'translator_host.h', + 'translator_logger.cc', + 'translator_logger.h', + 'translator_option_data.cc', + 'translator_option_data.h', + 'translator_option_def.cc', + 'translator_option_def.h', + 'translator_pd_pool.cc', + 'translator_pd_pool.h', + 'translator_pool.cc', + 'translator_pool.h', + 'translator_shared_network.cc', + 'translator_shared_network.h', + 'translator_subnet.cc', + 'translator_subnet.h', + 'yang_models.h', + 'yang_revisions.h', + dependencies: netconf_deps_array, + include_directories: [include_directories('.')] + INCLUDES, + install: true, + install_dir: 'lib', + link_with: LIBS_BUILT_SO_FAR, + override_options: ['cpp_std=c++20'], ) -libs_built_so_far += [kea_yang_lib] +LIBS_BUILT_SO_FAR = [kea_yang_lib] + LIBS_BUILT_SO_FAR diff --git a/src/share/api/meson.build b/src/share/api/meson.build index e69de29bb2..8b13789179 100644 --- a/src/share/api/meson.build +++ b/src/share/api/meson.build @@ -0,0 +1 @@ + diff --git a/src/share/database/meson.build b/src/share/database/meson.build index e69de29bb2..8b13789179 100644 --- a/src/share/database/meson.build +++ b/src/share/database/meson.build @@ -0,0 +1 @@ + diff --git a/src/share/yang/meson.build b/src/share/yang/meson.build index e69de29bb2..8b13789179 100644 --- a/src/share/yang/meson.build +++ b/src/share/yang/meson.build @@ -0,0 +1 @@ +