]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3731] Meson options are now features
authorAndrei Pavel <andrei@isc.org>
Mon, 10 Mar 2025 12:08:51 +0000 (14:08 +0200)
committerFrancis Dupont <fdupont@isc.org>
Thu, 13 Mar 2025 17:03:37 +0000 (18:03 +0100)
Also:
- Add fallback subprojects so that auto_features can take effect.
- Remove -Dall option. auto_features can be used instead.
- Add _dep suffix to dependency names.
- Capitalize dependencies that are used in other meson.build files.

145 files changed:
compiler-checks/fuzzing-with-clusterfuzzlite.cc [new file with mode: 0644]
fuzz/meson.build
meson.build
meson.options
src/bin/admin/tests/meson.build
src/bin/agent/meson.build
src/bin/agent/tests/meson.build
src/bin/d2/meson.build
src/bin/d2/tests/meson.build
src/bin/dhcp4/meson.build
src/bin/dhcp4/tests/meson.build
src/bin/dhcp6/meson.build
src/bin/dhcp6/tests/meson.build
src/bin/keactrl/meson.build
src/bin/keactrl/tests/meson.build
src/bin/lfc/tests/meson.build
src/bin/netconf/meson.build
src/bin/netconf/tests/meson.build
src/bin/netconf/tests/shtests/meson.build
src/bin/perfdhcp/meson.build
src/bin/perfdhcp/tests/meson.build
src/bin/shell/meson.build
src/bin/shell/tests/meson.build
src/hooks/d2/gss_tsig/libloadtests/meson.build
src/hooks/d2/gss_tsig/meson.build
src/hooks/d2/gss_tsig/tests/meson.build
src/hooks/d2/gss_tsig/testutils/meson.build
src/hooks/dhcp/bootp/libloadtests/meson.build
src/hooks/dhcp/bootp/tests/meson.build
src/hooks/dhcp/class_cmds/libloadtests/meson.build
src/hooks/dhcp/class_cmds/meson.build
src/hooks/dhcp/class_cmds/tests/meson.build
src/hooks/dhcp/ddns_tuning/libloadtests/meson.build
src/hooks/dhcp/ddns_tuning/meson.build
src/hooks/dhcp/ddns_tuning/tests/meson.build
src/hooks/dhcp/flex_id/libloadtests/meson.build
src/hooks/dhcp/flex_id/meson.build
src/hooks/dhcp/flex_id/tests/meson.build
src/hooks/dhcp/flex_option/libloadtests/meson.build
src/hooks/dhcp/flex_option/meson.build
src/hooks/dhcp/flex_option/tests/meson.build
src/hooks/dhcp/forensic_log/libloadtests/meson.build
src/hooks/dhcp/forensic_log/meson.build
src/hooks/dhcp/forensic_log/tests/meson.build
src/hooks/dhcp/high_availability/libloadtests/meson.build
src/hooks/dhcp/high_availability/meson.build
src/hooks/dhcp/high_availability/tests/meson.build
src/hooks/dhcp/host_cache/libloadtests/meson.build
src/hooks/dhcp/host_cache/meson.build
src/hooks/dhcp/host_cache/tests/meson.build
src/hooks/dhcp/host_cmds/libloadtests/meson.build
src/hooks/dhcp/host_cmds/meson.build
src/hooks/dhcp/host_cmds/tests/meson.build
src/hooks/dhcp/lease_cmds/libloadtests/meson.build
src/hooks/dhcp/lease_cmds/meson.build
src/hooks/dhcp/lease_cmds/tests/meson.build
src/hooks/dhcp/lease_query/libloadtests/meson.build
src/hooks/dhcp/lease_query/meson.build
src/hooks/dhcp/lease_query/tests/meson.build
src/hooks/dhcp/limits/libloadtests/meson.build
src/hooks/dhcp/limits/meson.build
src/hooks/dhcp/limits/tests/meson.build
src/hooks/dhcp/mysql/libloadtests/meson.build
src/hooks/dhcp/mysql/meson.build
src/hooks/dhcp/mysql/tests/meson.build
src/hooks/dhcp/perfmon/libloadtests/meson.build
src/hooks/dhcp/perfmon/meson.build
src/hooks/dhcp/perfmon/tests/meson.build
src/hooks/dhcp/pgsql/libloadtests/meson.build
src/hooks/dhcp/pgsql/meson.build
src/hooks/dhcp/pgsql/tests/meson.build
src/hooks/dhcp/ping_check/libloadtests/meson.build
src/hooks/dhcp/ping_check/meson.build
src/hooks/dhcp/ping_check/tests/meson.build
src/hooks/dhcp/radius/libloadtests/meson.build
src/hooks/dhcp/radius/meson.build
src/hooks/dhcp/radius/tests/meson.build
src/hooks/dhcp/run_script/libloadtests/meson.build
src/hooks/dhcp/run_script/meson.build
src/hooks/dhcp/run_script/tests/meson.build
src/hooks/dhcp/stat_cmds/libloadtests/meson.build
src/hooks/dhcp/stat_cmds/meson.build
src/hooks/dhcp/stat_cmds/tests/meson.build
src/hooks/dhcp/subnet_cmds/libloadtests/meson.build
src/hooks/dhcp/subnet_cmds/meson.build
src/hooks/dhcp/subnet_cmds/tests/meson.build
src/hooks/dhcp/user_chk/tests/meson.build
src/lib/asiodns/tests/meson.build
src/lib/asiolink/meson.build
src/lib/asiolink/tests/meson.build
src/lib/asiolink/testutils/meson.build
src/lib/cc/meson.build
src/lib/cc/tests/meson.build
src/lib/config/meson.build
src/lib/config/tests/meson.build
src/lib/config_backend/tests/meson.build
src/lib/cryptolink/meson.build
src/lib/cryptolink/tests/meson.build
src/lib/d2srv/meson.build
src/lib/d2srv/tests/meson.build
src/lib/d2srv/testutils/meson.build
src/lib/database/tests/meson.build
src/lib/database/testutils/meson.build
src/lib/dhcp/tests/meson.build
src/lib/dhcp/testutils/meson.build
src/lib/dhcp_ddns/tests/meson.build
src/lib/dhcpsrv/meson.build
src/lib/dhcpsrv/tests/meson.build
src/lib/dhcpsrv/testutils/meson.build
src/lib/dns/tests/meson.build
src/lib/eval/tests/meson.build
src/lib/exceptions/tests/meson.build
src/lib/hooks/tests/meson.build
src/lib/http/meson.build
src/lib/http/tests/meson.build
src/lib/log/interprocess/tests/meson.build
src/lib/log/meson.build
src/lib/log/tests/meson.build
src/lib/mysql/meson.build
src/lib/mysql/tests/meson.build
src/lib/mysql/testutils/meson.build
src/lib/pgsql/meson.build
src/lib/pgsql/tests/meson.build
src/lib/pgsql/testutils/meson.build
src/lib/process/cfgrpt/tests/meson.build
src/lib/process/meson.build
src/lib/process/tests/meson.build
src/lib/process/testutils/meson.build
src/lib/stats/tests/meson.build
src/lib/tcp/meson.build
src/lib/tcp/tests/meson.build
src/lib/testutils/meson.build
src/lib/util/tests/meson.build
src/lib/util/unittests/meson.build
src/lib/yang/meson.build
src/lib/yang/pretests/meson.build
src/lib/yang/tests/meson.build
src/lib/yang/testutils/meson.build
src/share/yang/modules/meson.build
src/share/yang/modules/utils/meson.build
subprojects/krb5/meson.build [new file with mode: 0644]
subprojects/log4cplus/meson.build [new file with mode: 0644]
subprojects/mysql/meson.build [new file with mode: 0644]
subprojects/netconf/meson.build [new file with mode: 0644]
subprojects/postgresql/meson.build [new file with mode: 0644]

diff --git a/compiler-checks/fuzzing-with-clusterfuzzlite.cc b/compiler-checks/fuzzing-with-clusterfuzzlite.cc
new file mode 100644 (file)
index 0000000..6346e2d
--- /dev/null
@@ -0,0 +1,3 @@
+int main() {
+    return 1;
+}
index 8336636a5666cce169ef745e7b443eab17ebd693..4d7c6aa116cd9a429eda7eb00bc9f83ccf185e25 100644 (file)
@@ -1,4 +1,4 @@
-if FUZZ_OPT != 'enabled'
+if not FUZZ_OPT.enabled()
     subdir_done()
 endif
 
@@ -10,7 +10,7 @@ cpp_flags = [
     f'-DKEA_LFC_SOURCES="@KEA_LFC@"',
     f'-DKEA_LFC_INSTALLATION="@PREFIX@/sbin/kea-lfc"',
 ]
-if FUZZ_OPT == 'clusterfuzzlite'
+if FUZZING_WITH_CLUSTERFUZZLITE
     cpp_flags = ['-fsanitize=fuzzer', '-gdwarf-4']
 else
     fuzz_sources += ['main.cc']
@@ -22,7 +22,7 @@ fuzz_lib = static_library(
     'fuzz_lib',
     fuzz_sources,
     cpp_args: cpp_flags,
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: includes,
     link_with: LIBS_BUILT_SO_FAR,
 )
@@ -32,7 +32,7 @@ executable(
     'fuzz_config_kea_dhcp4.cc',
     fuzz_sources,
     cpp_args: cpp_flags,
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: includes,
     link_with: [dhcp4_lib, fuzz_lib] + LIBS_BUILT_SO_FAR,
 )
@@ -42,7 +42,7 @@ executable(
     'fuzz_config_kea_dhcp6.cc',
     fuzz_sources,
     cpp_args: cpp_flags,
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: includes,
     link_with: [dhcp6_lib, fuzz_lib] + LIBS_BUILT_SO_FAR,
 )
@@ -52,7 +52,7 @@ executable(
     'fuzz_http_endpoint_kea_dhcp4.cc',
     fuzz_sources,
     cpp_args: cpp_flags,
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: includes,
     link_with: [dhcp4_lib, fuzz_lib] + LIBS_BUILT_SO_FAR,
 )
@@ -62,7 +62,7 @@ executable(
     'fuzz_http_endpoint_kea_dhcp6.cc',
     fuzz_sources,
     cpp_args: cpp_flags,
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: includes,
     link_with: [dhcp6_lib, fuzz_lib] + LIBS_BUILT_SO_FAR,
 )
@@ -72,7 +72,7 @@ executable(
     'fuzz_packets_kea_dhcp4.cc',
     fuzz_sources,
     cpp_args: cpp_flags,
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: includes,
     link_with: [dhcp4_lib, kea_dhcpsrv_lib, fuzz_lib] + LIBS_BUILT_SO_FAR,
 )
@@ -82,7 +82,7 @@ executable(
     'fuzz_packets_kea_dhcp6.cc',
     fuzz_sources,
     cpp_args: cpp_flags,
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: includes,
     link_with: [dhcp6_lib, kea_dhcpsrv_lib, fuzz_lib] + LIBS_BUILT_SO_FAR,
 )
@@ -92,7 +92,7 @@ executable(
     'fuzz_unix_socket_kea_dhcp4.cc',
     fuzz_sources,
     cpp_args: cpp_flags,
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: includes,
     link_with: [dhcp4_lib, kea_testutils_lib, fuzz_lib] + LIBS_BUILT_SO_FAR,
 )
@@ -102,7 +102,7 @@ executable(
     'fuzz_unix_socket_kea_dhcp6.cc',
     fuzz_sources,
     cpp_args: cpp_flags,
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: includes,
     link_with: [dhcp6_lib, kea_testutils_lib, fuzz_lib] + LIBS_BUILT_SO_FAR,
 )
index 3d21739da621ad0b2be7655af1e503cb715022e7..ccd3da9e2511549ca1a951d2f17476c4d5124673 100644 (file)
@@ -28,9 +28,7 @@ LEGAL_LOG_DIR = f'@PREFIX@/@RUN_STATE_DIR@/lib/kea'
 
 #### Build Options
 
-all_opt = get_option('all')
 crypto_opt = get_option('crypto')
-gtest_opt = get_option('gtest')
 krb5_opt = get_option('krb5')
 mysql_opt = get_option('mysql')
 netconf_opt = get_option('netconf')
@@ -38,8 +36,8 @@ postgresql_opt = get_option('postgresql')
 
 logger_checks_opt = get_option('logger-checks')
 FUZZ_OPT = get_option('fuzz')
-PERFDHCP_OPT = get_option('perfdhcp')
 SHELL_OPT = get_option('shell')
+TESTS_OPT = get_option('tests')
 
 #### Configuration Data
 
@@ -47,7 +45,6 @@ conf_data = configuration_data(
     {
         # 'CONFIG_H_WAS_INCLUDED': true,
         # 'ENABLE_DEBUG': false,
-        # 'ENABLE_LOGGER_CHECKS': false,
         'EXTENDED_VERSION': '"tarball"',
         # 'HAS_UNDEFINED_PTHREAD_BEHAVIOR': false,
         # 'HAVE_AFL': false,
@@ -85,7 +82,6 @@ conf_data = configuration_data(
         # 'HAVE_LOG': false,
         # 'HAVE_MYSQL_GET_OPTION': false,
         # 'HAVE_MYSQL_OPT_RECONNECT': false,
-        # 'HAVE_NETCONF': false,
         # 'HAVE_OPTRESET': false,
         # 'HAVE_PGSQL_SSL': false,
         # 'HAVE_PGSQL_TCP_USER_TIMEOUT': false,
@@ -183,27 +179,16 @@ KEA_MSG_COMPILER = disabler()
 
 #### Dependencies
 
-boost = dependency('boost', version: '>=1.66')
-threads = dependency('threads')
-add_project_dependencies(boost, threads, language: ['cpp'])
-
-gtest = disabler()
-if gtest_opt == 'enabled'
-    gtest = dependency('gtest', required: true)
-endif
+boost_dep = dependency('boost', version: '>=1.66')
+threads_dep = dependency('threads')
+add_project_dependencies(boost_dep, threads_dep, language: ['cpp'])
 
 # Logging
-log4cplus = dependency('log4cplus', required: false)
-# TODO: leave only dependecy() when support for Ubuntu 20.04 gets removed.
-if not log4cplus.found()
-    log4cplus = cpp.find_library('log4cplus', required: false)
-endif
-if not log4cplus.found()
-    error('Dependency not found: log4cplus.')
-endif
+# TODO: remove fallback when support for Ubuntu 20.04 gets removed.
+LOG4CPLUS_DEP = dependency('log4cplus', fallback: ['log4cplus', 'log4cplus'])
 
 # Cryptography
-crypto = disabler()
+CRYPTO_DEP = disabler()
 botan = disabler()
 foreach dep : ['botan-2', 'botan']
     botan = dependency(dep, required: false)
@@ -214,256 +199,79 @@ endforeach
 openssl = dependency('openssl', required: false)
 
 # Kerberos
-krb5 = disabler()
-krb5_config = find_program('krb5-config', required: false)
-if krb5_config.found()
-    cflags = run_command([krb5_config, '--cflags', 'gssapi'], check: false)
-    libs = run_command([krb5_config, '--libs', 'gssapi'], check: false)
-    version = run_command([krb5_config, '--version'], check: false)
-    if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0
-        krb5_version = version.stdout().strip()
-        krb5 = declare_dependency(
-            compile_args: cflags.stdout().split(),
-            link_args: libs.stdout().split(),
-            version: krb5_version,
-        )
-    endif
-endif
-if not krb5.found()
-    krb5 = dependency('krb5', required: false)
-endif
+KRB5_DEP = dependency(
+    'krb5-gssapi',
+    fallback: ['krb5', 'krb5'],
+    required: krb5_opt,
+)
 
 # MySQL
-mysql = dependency('mariadb', required: false)
-if not mysql.found()
-    mysql = dependency('mysql', required: false)
-endif
-mysql_config = disabler()
-foreach mysql_config_file : ['mariadb_config', 'mysql_config']
-    if mysql.found()
-        continue
-    endif
-    mysql_config = find_program(mysql_config_file, required: false)
-    if not mysql_config.found()
-        continue
-    endif
-    cflags = run_command([mysql_config, '--cflags'], check: false)
-    libs = run_command([mysql_config, '--libs'], check: false)
-    version = run_command([mysql_config, '--version'], check: false)
-
-    if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0
-        mysql_compile_args = cflags.stdout().split()
-        mysql_link_args = libs.stdout().split()
-        mysql_version = version.stdout().strip()
-        mysql = declare_dependency(
-            compile_args: mysql_compile_args,
-            link_args: mysql_link_args,
-            version: mysql_version,
-        )
-        break
-    endif
-endforeach
+MYSQL_DEP = dependency(
+    'mariadb',
+    fallback: ['mysql', 'mysql'],
+    required: mysql_opt,
+)
 
 # PostgreSQL
-postgresql = dependency('libpq', required: false)
-pg_config = disabler()
-if not postgresql.found()
-    pg_config = find_program('pg_config', required: false)
-endif
-if pg_config.found()
-    cflags = run_command([pg_config, '--cflags'], check: false)
-    libs = run_command([pg_config, '--libs'], check: false)
-    version = run_command([pg_config, '--version'], check: false)
-    if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0
-        pgsql_compile_args = cflags.stdout().split()
-        pgsql_link_args = libs.stdout().split()
-        pgsql_version = version.stdout().strip()
-        postgresql = declare_dependency(
-            compile_args: pgsql_compile_args,
-            link_args: pgsql_link_args,
-            version: pgsql_version,
-        )
-    endif
-endif
+POSTGRESQL_DEP = dependency(
+    'libpq',
+    fallback: ['postgresql', 'postgresql'],
+    required: postgresql_opt,
+)
 
 # NETCONF
-netconf_deps = {}
-NETCONF_DEPS_ARRAY = []
-NETCONF_DEPS_FOUND = true
-foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp']
-    netconf_deps = netconf_deps + {dep: dependency(dep, required: false)}
-    if netconf_deps[dep].found()
-        continue
-    endif
-
-    # Try adding lib to it. libyang and libyang-cpp define the wrong pkg-config.
-    netconf_deps = netconf_deps + {
-        dep: dependency('lib' + dep, required: false),
-    }
-    if netconf_deps[dep].found()
-        continue
-    endif
+NETCONF_DEP = dependency(
+    'yang,yang-cpp,sysrepo,sysrepo-cpp',
+    fallback: ['netconf', 'netconf'],
+    required: netconf_opt,
+)
+if netconf_opt.enabled() and NETCONF_DEP.get_variable('libyang_prefix', default_value: 'unknown') == 'unknown'
+    error('Dependency not found: NETCONF.')
+endif
 
-    # Search in /opt.
-    foreach prefix : ['', 'lib']
-        path = f'/opt/@prefix@@dep@'
-        lib = cpp.find_library(dep, dirs: [f'/@path@/lib'], required: false)
-        if lib.found()
-            netconf_deps = netconf_deps + {
-                dep: declare_dependency(
-                    dependencies: [lib],
-                    include_directories: include_directories(f'/@path@/include'),
-                    variables: {'prefix': f'@path@'},
-                ),
-            }
-            if SYSTEM == 'darwin'
-                add_project_link_arguments(
-                    f'-Wl,-rpath,@path@/lib',
-                    language: 'cpp',
-                )
-            else
-                add_project_link_arguments(
-                    f'-Wl,-rpath=@path@/lib',
-                    language: 'cpp',
-                )
-            endif
-        endif
-    endforeach
-endforeach
-foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp']
-    if netconf_deps[dep].found()
-        NETCONF_DEPS_ARRAY += netconf_deps[dep]
-    else
-        NETCONF_DEPS_FOUND = false
-    endif
-endforeach
+GTEST_DEP = dependency(
+    'gtest',
+    required: TESTS_OPT.enabled() or FUZZ_OPT.enabled(),
+)
 
 # Kea shell
-if SHELL_OPT == 'enabled' and not PYTHON.found()
+if SHELL_OPT.enabled() and not PYTHON.found()
     error('kea-shell requires python. Python not found.')
 endif
 
 # Crypto
 if crypto_opt == 'botan'
     if botan.found()
-        crypto = botan
+        CRYPTO_DEP = botan
     endif
 elif crypto_opt == 'openssl'
     if openssl.found()
-        crypto = openssl
+        CRYPTO_DEP = openssl
     endif
 endif
 
-if crypto.name() == botan.name()
+if CRYPTO_DEP.name() == botan.name()
     message('Checking Botan Boost support.')
     cpp.has_header('botan/asio_stream.h', dependencies: [botan], required: true)
     conf_data.set('WITH_BOTAN', true)
     message('Using Botan.')
-elif crypto.name() == openssl.name()
+elif CRYPTO_DEP.name() == openssl.name()
     conf_data.set('WITH_OPENSSL', true)
     message('Using OpenSSL.')
 else
     error('Dependency not found: neither Botan nor OpenSSL.')
 endif
 
-# All option.
-if all_opt.enabled()
-    if krb5_opt == 'disabled'
-        krb5 = disabler()
-    elif not krb5.found()
-        error('Dependency not found: Kerberos 5 with GSSAPI.')
-    endif
-    if mysql_opt == 'disabled'
-        mysql = disabler()
-    elif not mysql.found()
-        error('Dependency not found: MySQL.')
-    endif
-    if netconf_opt == 'disabled'
-        NETCONF_DEPS_FOUND = false
-    elif not NETCONF_DEPS_FOUND
-        error('Dependency not found: NETCONF.')
-    endif
-    if postgresql_opt == 'disabled'
-        postgresql = disabler()
-    elif not postgresql.found()
-        error('Dependency not found: PostgreSQL.')
-    endif
-    if FUZZ_OPT != 'disabled'
-        FUZZ_OPT = 'enabled'
-    endif
-    if PERFDHCP_OPT != 'disabled'
-        PERFDHCP_OPT = 'enabled'
-    endif
-    if SHELL_OPT != 'disabled'
-        SHELL_OPT = 'enabled'
-    endif
-elif all_opt.disabled()
-    if krb5_opt != 'enabled'
-        krb5 = disabler()
-    endif
-    if mysql_opt != 'enabled'
-        mysql = disabler()
-    endif
-    if netconf_opt != 'enabled'
-        NETCONF_DEPS_FOUND = false
-    endif
-    if postgresql_opt != 'enabled'
-        postgresql = disabler()
-    endif
-    if FUZZ_OPT != 'enabled'
-        FUZZ_OPT = 'disabled'
-    endif
-    if PERFDHCP_OPT != 'enabled'
-        PERFDHCP_OPT = 'disabled'
-    endif
-    if SHELL_OPT != 'enabled'
-        SHELL_OPT = 'disabled'
-    endif
-elif all_opt.auto()
-    if krb5_opt == 'enabled' and not krb5.found()
-        error('Dependency not found: Kerberos 5 with GSSAPI.')
-    endif
-
-    if mysql_opt == 'enabled' and not mysql.found()
-        error('Dependency not found: MySQL.')
-    endif
-
-    if netconf_opt == 'enabled' and not NETCONF_DEPS_FOUND
-        error('Dependency not found: NETCONF.')
-    endif
-
-    if postgresql_opt == 'enabled' and not postgresql.found()
-        error('Dependency not found: PostgreSQL.')
-    endif
-else
-    error('Unknown value for -Dall')
-endif
-
-if FUZZ_OPT == 'enabled'
-    if not gtest.found()
-        error('Fuzzing requires gtest. Gtest not found.')
-    endif
-    conf_data.set('FUZZING', true)
-endif
-
-if mysql.found()
-    conf_data.set('HAVE_MYSQL', true)
-endif
-
-if postgresql.found()
-    conf_data.set('HAVE_PGSQL', true)
-endif
-
-if logger_checks_opt == 'enabled'
-    conf_data.set('ENABLE_LOGGER_CHECKS', true)
-endif
+conf_data.set('ENABLE_LOGGER_CHECKS', logger_checks_opt.enabled())
+conf_data.set('FUZZING', FUZZ_OPT.enabled())
+conf_data.set('HAVE_MYSQL', MYSQL_DEP.found())
+conf_data.set('HAVE_PGSQL', POSTGRESQL_DEP.found())
 
 #### Compiler Checks
 
 result = cpp.run(
     fs.read('compiler-checks/chrono-same-duration.cc'),
     name: 'CHRONO_SAME_DURATION',
-    dependencies: [boost],
 )
 conf_data.set('CHRONO_SAME_DURATION', result.returncode() == 0)
 
@@ -483,7 +291,7 @@ endif
 result = cpp.run(
     fs.read('compiler-checks/have-generic-tls-method.cc'),
     name: 'HAVE_GENERIC_TLS_METHOD',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
 )
 conf_data.set('HAVE_GENERIC_TLS_METHOD', result.returncode() == 0)
 
@@ -499,15 +307,15 @@ conf_data.set('HAVE_SA_LEN', result.returncode() == 0)
 result = cpp.run(
     fs.read('compiler-checks/log4cplus-initializer.cc'),
     name: 'LOG4CPLUS_INITIALIZER_H',
-    dependencies: [log4cplus],
+    dependencies: [LOG4CPLUS_DEP],
 )
 conf_data.set('LOG4CPLUS_INITIALIZER_H', result.returncode() == 0)
 
-if mysql.found()
+if MYSQL_DEP.found()
     result = cpp.run(
         fs.read('compiler-checks/mysql-my-bool.cc'),
-        name: 'HAVE_MYSQL_MY_BOOL',
-        dependencies: [mysql],
+        name: 'MYSQL_MY_BOOL',
+        dependencies: [MYSQL_DEP],
     )
     conf_data.set('HAVE_MYSQL_MY_BOOL', result.returncode() == 0)
 endif
@@ -515,10 +323,17 @@ endif
 result = cpp.run(
     fs.read('compiler-checks/stream-truncated-error.cc'),
     name: 'HAVE_STREAM_TRUNCATED_ERROR',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
 )
 conf_data.set('HAVE_STREAM_TRUNCATED_ERROR', result.returncode() == 0)
 
+# TODO: implement when integrating with CI
+result = cpp.run(
+    fs.read('compiler-checks/fuzzing-with-clusterfuzzlite.cc'),
+    name: 'FUZZING_WITH_CLUSTERFUZZLITE',
+)
+FUZZING_WITH_CLUSTERFUZZLITE = result.returncode() == 0
+
 #### System-specific Compiler Flags
 
 compile_args = []
@@ -623,7 +438,6 @@ endif
 result = cpp.run(
     fs.read('compiler-checks/get-boost-version.cc'),
     name: 'Get Boost version',
-    dependencies: [boost],
 )
 if result.returncode() == 0
     report_conf_data.set('BOOST_VERSION', result.stdout().strip())
@@ -632,38 +446,38 @@ else
 endif
 report_conf_data.set(
     'BOOST_INCLUDE',
-    boost.get_variable('includedir', default_value: 'unknown'),
+    boost_dep.get_variable('includedir', default_value: 'unknown'),
 )
 report_conf_data.set(
     'BOOST_LIBDIR',
-    boost.get_variable('libdir', default_value: 'unknown'),
+    boost_dep.get_variable('libdir', default_value: 'unknown'),
 )
 report_conf_data.set(
     'CRYPTO_INCLUDE',
-    crypto.get_variable('includedir', default_value: 'unknown'),
+    CRYPTO_DEP.get_variable('includedir', default_value: 'unknown'),
 )
 report_conf_data.set(
     'CRYPTO_LIBDIR',
-    crypto.get_variable('libdir', default_value: 'unknown'),
+    CRYPTO_DEP.get_variable('libdir', default_value: 'unknown'),
 )
-if crypto.name() == botan.name()
+if CRYPTO_DEP.name() == botan.name()
     report_conf_data.set('CRYPTO_NAME', 'Botan')
     result = cpp.run(
         fs.read('compiler-checks/get-botan-version.cc'),
         name: 'Get Botan version',
-        dependencies: [crypto],
+        dependencies: [CRYPTO_DEP],
     )
     if result.returncode() == 0
         report_conf_data.set('CRYPTO_VERSION', result.stdout().strip())
     else
         report_conf_data.set('CRYPTO_VERSION', botan.version())
     endif
-elif crypto.name() == openssl.name()
+elif CRYPTO_DEP.name() == openssl.name()
     report_conf_data.set('CRYPTO_NAME', 'OpenSSL')
     result = cpp.run(
         fs.read('compiler-checks/get-openssl-version.cc'),
         name: 'Get OpenSSL version',
-        dependencies: [crypto],
+        dependencies: [CRYPTO_DEP],
     )
     if result.returncode() == 0
         report_conf_data.set('CRYPTO_VERSION', result.stdout().strip())
@@ -672,20 +486,23 @@ elif crypto.name() == openssl.name()
     endif
 endif
 # TODO: remove if-condition when support for Ubuntu 20.04 gets removed.
-if log4cplus.type_name() == 'pkgconfig'
+if LOG4CPLUS_DEP.type_name() == 'pkgconfig'
     report_conf_data.set(
         'LOG4CPLUS_INCLUDE',
-        log4cplus.get_variable('includedir', default_value: 'unknown'),
+        LOG4CPLUS_DEP.get_variable('includedir', default_value: 'unknown'),
     )
     report_conf_data.set(
         'LOG4CPLUS_LIBDIR',
-        log4cplus.get_variable('libdir', default_value: 'unknown'),
+        LOG4CPLUS_DEP.get_variable('libdir', default_value: 'unknown'),
     )
+else
+    report_conf_data.set('LOG4CPLUS_INCLUDE', 'unknown')
+    report_conf_data.set('LOG4CPLUS_LIBDIR', 'unknown')
 endif
 result = cpp.run(
     fs.read('compiler-checks/get-log4cplus-version.cc'),
     name: 'Get Log4cplus version',
-    dependencies: [log4cplus],
+    dependencies: [LOG4CPLUS_DEP],
 )
 if result.returncode() == 0
     report_conf_data.set('LOG4CPLUS_VERSION', result.stdout().strip())
@@ -702,63 +519,55 @@ if BISON.found()
 else
     report_conf_data.set('BISON', 'unknown')
 endif
-if mysql.found()
-    if not mysql_config.found()
-        report_conf_data.set('MYSQL_VERSION', mysql.version())
-        report_conf_data.set(
-            'MYSQL_INCLUDE',
-            mysql.get_variable('includedir', default_value: 'unknown'),
-        )
-        report_conf_data.set(
-            'MYSQL_LIBDIR',
-            mysql.get_variable('libdir', default_value: 'unknown'),
-        )
-    else
-        report_conf_data.set('MYSQL_VERSION', mysql_version)
-        report_conf_data.set('MYSQL_INCLUDE', ' '.join(mysql_compile_args))
-        report_conf_data.set('MYSQL_LIBDIR', ' '.join(mysql_link_args))
-    endif
+if MYSQL_DEP.found()
+    report_conf_data.set('MYSQL_VERSION', MYSQL_DEP.version())
+    report_conf_data.set(
+        'MYSQL_INCLUDE',
+        MYSQL_DEP.get_variable('includedir', default_value: 'unknown'),
+    )
+    report_conf_data.set(
+        'MYSQL_LIBDIR',
+        MYSQL_DEP.get_variable('libdir', default_value: 'unknown'),
+    )
 else
     report_conf_data.set('HAVE_MYSQL', 'no')
     report_conf_data.set('MYSQL_VERSION', 'unknown')
     report_conf_data.set('MYSQL_INCLUDE', 'unknown')
     report_conf_data.set('MYSQL_LIBDIR', 'unknown')
 endif
-if postgresql.found()
+if POSTGRESQL_DEP.found()
     report_conf_data.set('HAVE_PGSQL', 'yes')
-    if not pg_config.found()
-        report_conf_data.set('PGSQL_VERSION', postgresql.version())
-        report_conf_data.set(
-            'PGSQL_INCLUDE',
-            postgresql.get_variable('includedir', default_value: 'unknown'),
-        )
-        report_conf_data.set(
-            'PGSQL_LIBDIR',
-            postgresql.get_variable('libdir', default_value: 'unknown'),
-        )
-    else
-        report_conf_data.set('PGSQL_VERSION', pgsql_version)
-        report_conf_data.set('PGSQL_INCLUDE', ' '.join(pgsql_compile_args))
-        report_conf_data.set('PGSQL_LIBDIR', ' '.join(pgsql_link_args))
-    endif
+    report_conf_data.set('PGSQL_VERSION', POSTGRESQL_DEP.version())
+    report_conf_data.set(
+        'PGSQL_INCLUDE',
+        POSTGRESQL_DEP.get_variable('includedir', default_value: 'unknown'),
+    )
+    report_conf_data.set(
+        'PGSQL_LIBDIR',
+        POSTGRESQL_DEP.get_variable('libdir', default_value: 'unknown'),
+    )
 else
     report_conf_data.set('HAVE_PGSQL', 'no')
     report_conf_data.set('PGSQL_VERSION', 'unknown')
     report_conf_data.set('PGSQL_INCLUDE', 'unknown')
     report_conf_data.set('PGSQL_LIBDIR', 'unknown')
 endif
-report_conf_data.set('HAVE_NETCONF', 'no')
-if gtest.found()
+if NETCONF_DEP.found()
+    report_conf_data.set('HAVE_NETCONF', 'yes')
+else
+    report_conf_data.set('HAVE_NETCONF', 'no')
+endif
+if FUZZ_OPT.enabled() or TESTS_OPT.enabled()
     report_conf_data.set('HAVE_GTEST', 'yes')
     report_conf_data.set(
         'GTEST_INCLUDE',
-        gtest.get_variable('includedir', default_value: 'unknown'),
+        GTEST_DEP.get_variable('includedir', default_value: 'unknown'),
     )
     report_conf_data.set(
         'GTEST_LIBDIR',
-        gtest.get_variable('libdir', default_value: 'unknown'),
+        GTEST_DEP.get_variable('libdir', default_value: 'unknown'),
     )
-    report_conf_data.set('GTEST_VERSION', gtest.version())
+    report_conf_data.set('GTEST_VERSION', GTEST_DEP.version())
 else
     report_conf_data.set('HAVE_GTEST', 'no')
     report_conf_data.set('GTEST_VERSION', 'unknown')
@@ -887,7 +696,7 @@ subdir('src')
 subdir('fuzz')
 subdir('doc')
 subdir('premium', if_found: premium)
-subdir('contrib', if_found: contrib)
+subproject('contrib', required: false)
 
 #### More Custom Targets
 
index 057a3a62c8c22a0c042fce6311030c9e17e6c124..a72b100c916e6263e2b5b9ff53779e87125c75d1 100644 (file)
@@ -1,28 +1,31 @@
-# all
+# Dependency-related options
+option(
+    'crypto',
+    type: 'combo',
+    choices: ['botan', 'openssl'],
+    value: 'openssl',
+    description: 'Backend for cryptographical operations. Mandatory.',
+)
 option(
-    'all',
+    'krb5',
     type: 'feature',
-    value: 'disabled',
-    description: 'Requires that all C++ dependencies be enabled: crypto (either botan or openssl), krb5 with gssapi, mysql, netconf, postgresql. Also enables generation of docs and parser which requires bison, flex, and sphinx. Also enables all parts of code: debug, fuzzing, logger-checks, perfdhcp, shell. Overrides the other options.',
+    description: 'Support for GSS-TSIG. Requires krb5 with gssapi.',
+)
+option('mysql', type: 'feature', description: 'Support for MySQL backends.')
+option('netconf', type: 'feature', description: 'Support for kea-netconf.')
+option(
+    'postgresql',
+    type: 'feature',
+    description: 'Support for PostgreSQL backends.',
 )
-
-# Dependency-related options
-option('crypto', type: 'combo', choices: ['botan', 'openssl'], value: 'openssl', description: 'Backend for cryptographical operations. Mandatory.')
-option('krb5', type: 'combo', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for GSS-TSIG. Requires krb5 with gssapi.')
-option('mysql', type: 'combo', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for MySQL backends.')
-option('netconf', type: 'combo', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for kea-netconf.')
-option('postgresql', type: 'combo', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for PostgreSQL backends.')
-
-# Used for development.
-# option('docs', type: 'feature', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for doc generation.')
-# option('parser', type: 'feature', choices: ['', 'auto', 'enabled', 'disabled'], value: '', description: 'Support for parser generation.')
 
 # Options for enabling various parts of code.
-# not only unit tests...
-option('gtest', type: 'combo', choices: ['enabled', 'disabled'], value: 'disabled', description: 'Support for tests.')
-# debug?
-# logger-checks (uses assert so only for development).
-option('logger-checks', type: 'combo', choices: ['enabled', 'disabled'], value: 'disabled', description: 'Check logger messages.')
-option('fuzz', type: 'combo', choices: ['', 'auto', 'clusterfuzzlite', 'disabled', 'enabled'], value: '', description: 'Support for fuzz testing.')
-option('perfdhcp', type: 'combo', choices: ['', 'auto', 'disabled', 'enabled'], value: '', description: 'Builds perfdhcp.')
-option('shell', type: 'combo', choices: ['', 'auto', 'disabled', 'enabled'], value: '', description: 'Builds kea-shell.')
+option('fuzz', type: 'feature', description: 'Support for fuzz testing.')
+option(
+    'logger-checks',
+    type: 'feature',
+    value: 'disabled',
+    description: 'Check logger messages.',
+)
+option('shell', type: 'feature', description: 'Builds kea-shell.')
+option('tests', type: 'feature', description: 'Support for tests.')
index ed257f97ebbf93a1d861c1f3df0d5df5a9b778f7..502c0e0964f2041a613cfccd07e5fb4da874271f 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -35,7 +35,7 @@ mysql_tests = configure_file(
     output: 'mysql_tests.sh',
     configuration: kea_admin_tests_conf_data,
 )
-if mysql.found()
+if MYSQL_DEP.found()
     test(
         'kea_admin_mysql_tests.sh',
         mysql_tests,
@@ -49,7 +49,7 @@ pgsql_tests = configure_file(
     output: 'pgsql_tests.sh',
     configuration: kea_admin_tests_conf_data,
 )
-if postgresql.found()
+if POSTGRESQL_DEP.found()
     test(
         'kea_admin_pgsql_tests.sh',
         pgsql_tests,
index 823fb9e26949c1846153253e2688d61d7fdd8c0c..fa66ad2b88264c29c2978ad97c61cc20a0824b6c 100644 (file)
@@ -11,13 +11,13 @@ agent_lib = static_library(
     'ca_response_creator.cc',
     'parser_context.cc',
     'simple_parser.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
 )
 executable(
     'kea-ctrl-agent',
     'main.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'sbin',
index bc9af0b942e819aa9b51574cdeb0e1e7efeefd89..43b814d413d7847bb55cf537fc5d26d083db36d3 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -77,7 +77,7 @@ kea_agent_tests = executable(
         f'-DSYNTAX_FILE="@current_source_dir@/../agent_parser.yy"',
         f'-DTEST_CA_DIR="@TEST_CA_DIR@"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [agent_lib] + kea_agent_tests_libs + LIBS_BUILT_SO_FAR,
 )
index 5f8065f239d7f0b2b5a7f4868ff77c5624ac1f07..dd2467cde99f6caa991f5b69507a18359f700179 100644 (file)
@@ -15,13 +15,13 @@ d2_lib = static_library(
     'simple_add_without_dhcid.cc',
     'simple_remove.cc',
     'simple_remove_without_dhcid.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
 )
 executable(
     'kea-dhcp-ddns',
     'main.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'sbin',
index f464393ee6da918c01cabcb10715ea442671e178..10a806b21966edbdb6b07b0c7609ae1f0657997b 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -88,7 +88,7 @@ kea_d2_tests = executable(
         f'-DSYNTAX_FILE="@current_source_dir@/../d2_parser.yy"',
         f'-DTEST_CA_DIR="@TEST_CA_DIR@"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [d2_lib] + kea_d2_tests_libs + LIBS_BUILT_SO_FAR,
 )
index 3766f8cd6cf034d6173a5b50dedeb6a6ac1a42d6..1d4cebb517e5aa8df01610f30d393c4f34791ed1 100644 (file)
@@ -10,13 +10,13 @@ dhcp4_lib = static_library(
     'dhcp4_srv.cc',
     'json_config_parser.cc',
     'parser_context.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
 )
 kea_dhcp4 = executable(
     'kea-dhcp4',
     'main.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'sbin',
index 2102956f887f6d1d88dfbd7dbd2f2759112c3629..9ae49c9f7aadadae00502204ac11fe19a2b2eda8 100644 (file)
@@ -1,10 +1,10 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
 current_build_dir = meson.current_build_dir()
 current_source_dir = meson.current_source_dir()
-dhcp4_tests_deps = [crypto, gtest]
+dhcp4_tests_deps = [CRYPTO_DEP, GTEST_DEP]
 dhcp4_tests_libs = [
     kea_dhcpsrv_testutils_lib,
     kea_dhcp_testutils_lib,
@@ -13,16 +13,16 @@ dhcp4_tests_libs = [
     kea_util_unittests_lib,
     kea_asiolink_testutils_lib,
 ]
-if mysql.found()
-    dhcp4_tests_deps += [mysql]
+if MYSQL_DEP.found()
+    dhcp4_tests_deps += [MYSQL_DEP]
     dhcp4_tests_libs += [
         dhcp_mysql_archive,
         kea_mysql_testutils_lib,
         kea_mysql_lib,
     ]
 endif
-if postgresql.found()
-    dhcp4_tests_deps += [postgresql]
+if POSTGRESQL_DEP.found()
+    dhcp4_tests_deps += [POSTGRESQL_DEP]
     dhcp4_tests_libs += [
         dhcp_pgsql_archive,
         kea_pgsql_testutils_lib,
index a6f2738d82ed045126d13046e3170f117e5404b3..359a77559bca313203f80ef14e7fbafba507b720 100644 (file)
@@ -11,13 +11,13 @@ dhcp6_lib = static_library(
     'json_config_parser.cc',
     'main.cc',
     'parser_context.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
 )
 kea_dhcp6 = executable(
     'kea-dhcp6',
     'main.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'sbin',
index 1b4e47b808d82868c8e9674fe3acb335cc69d4d7..a7f6cccea483954904b1464074f67ed7fd4f1890 100644 (file)
@@ -1,10 +1,10 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
 current_build_dir = meson.current_build_dir()
 current_source_dir = meson.current_source_dir()
-dhcp6_tests_deps = [crypto, gtest]
+dhcp6_tests_deps = [CRYPTO_DEP, GTEST_DEP]
 dhcp6_tests_libs = [
     kea_dhcpsrv_testutils_lib,
     kea_dhcp_testutils_lib,
@@ -13,16 +13,16 @@ dhcp6_tests_libs = [
     kea_util_unittests_lib,
     kea_asiolink_testutils_lib,
 ]
-if mysql.found()
-    dhcp6_tests_deps += [mysql]
+if MYSQL_DEP.found()
+    dhcp6_tests_deps += [MYSQL_DEP]
     dhcp6_tests_libs += [
         dhcp_mysql_archive,
         kea_mysql_testutils_lib,
         kea_mysql_lib,
     ]
 endif
-if postgresql.found()
-    dhcp6_tests_deps += [postgresql]
+if POSTGRESQL_DEP.found()
+    dhcp6_tests_deps += [POSTGRESQL_DEP]
     dhcp6_tests_libs += [
         dhcp_pgsql_archive,
         kea_pgsql_testutils_lib,
index 85103c1b4dfc270c0bcb53ff6f22079c26337fc8..53d04d33f629195432155a8713fd2cd76acdbdbe 100644 (file)
@@ -4,7 +4,7 @@ keactrl_conf_data.set('sysconfdir', '${prefix}/' + SYSCONFDIR)
 keactrl_conf_data.set('PACKAGE', 'kea')
 keactrl_conf_data.set('exec_prefix', '${prefix}')
 keactrl_conf_data.set('sbindir', '${prefix}/' + get_option('sbindir'))
-if NETCONF_DEPS_FOUND
+if NETCONF_DEP.found()
     keactrl_conf_data.set('HAVE_NETCONF', 'yes')
 else
     keactrl_conf_data.set('HAVE_NETCONF', 'no')
@@ -59,7 +59,7 @@ configure_file(
     input: 'kea-netconf.conf.pre',
     output: 'kea-netconf.conf',
     command: [path_replacer, '@INPUT@', '@OUTPUT@'],
-    install: NETCONF_DEPS_FOUND,
+    install: NETCONF_DEP.found(),
     install_dir: kea_configfiles_destdir,
 )
 subdir('tests')
index 8fb0cb6718438fb2d41e64c2824291e18d83d80d..b307313d84b16992203fa992462b83f8db432090 100644 (file)
@@ -1,10 +1,10 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
 keactrl_tests_conf_data = configuration_data()
 keactrl_tests_conf_data.set('abs_top_builddir', TOP_BUILD_DIR)
-if NETCONF_DEPS_FOUND
+if NETCONF_DEP.found()
     keactrl_tests_conf_data.set('HAVE_NETCONF', 'yes')
 else
     keactrl_tests_conf_data.set('HAVE_NETCONF', 'no')
index 2b5fa6255fd89b41fa5c30ccc099c542efb20c7b..59692ce1a43fac60dc8df962867428730b6fc2ea 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -8,7 +8,7 @@ kea_lfc_tests = executable(
     'lfc_controller_unittests.cc',
     'lfc_unittests.cc',
     cpp_args: [f'-DTEST_DATA_BUILDDIR="@current_build_dir@"'],
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [lfc_lib] + LIBS_BUILT_SO_FAR,
 )
index a9b4a2b6540748d77d3158ed7d0804c51200a034..291eee3e3c70219bd6771ea0ac153298e537fc84 100644 (file)
@@ -1,4 +1,4 @@
-if not NETCONF_DEPS_FOUND
+if not NETCONF_DEP.found()
     subdir_done()
 endif
 
@@ -19,16 +19,16 @@ netconf_lib = static_library(
     'simple_parser.cc',
     'stdout_control_socket.cc',
     'unix_control_socket.cc',
-    dependencies: NETCONF_DEPS_ARRAY + [crypto],
+    dependencies: [NETCONF_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
-    link_with: [kea_yang_testutils_lib, kea_process_testutils_lib] + LIBS_BUILT_SO_FAR,
+    link_with: LIBS_BUILT_SO_FAR,
     override_options: ['cpp_std=c++20'],
 )
 
 executable(
     'kea-netconf',
     'main.cc',
-    dependencies: NETCONF_DEPS_ARRAY + [crypto],
+    dependencies: [NETCONF_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'sbin',
index e6d5f3930c232d9850f909755ced2c11ffdc7422..92a36e7c5d557caf186673d5157354be99bbc569 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found() or not NETCONF_DEPS_FOUND
+if not TESTS_OPT.enabled() or not NETCONF_DEP.found()
     subdir_done()
 endif
 
@@ -33,7 +33,7 @@ kea_netconf_tests = executable(
         f'-DTEST_DATA_SOURCEDIR="@current_source_dir@"',
         f'-DTEST_DATA_BUILDDIR="@current_build_dir@"',
     ],
-    dependencies: NETCONF_DEPS_ARRAY + [gtest, crypto],
+    dependencies: [NETCONF_DEP, GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [
         netconf_lib,
index f969fa028e703bfed933aa4ce07edec56ddfe463..257c366269e1a8c1395da598043ff79e6a33faf9 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
index 0df78a5901b8a95a5e97b42951047549259a6e1e..36c8353d9e2713b5197b55af270caa386c40304c 100644 (file)
@@ -1,7 +1,3 @@
-if PERFDHCP_OPT != 'enabled'
-    subdir_done()
-endif
-
 perfdhcp_lib = static_library(
     'perfdhcp',
     'avalanche_scen.cc',
index 96bd4b9a01f97365c37305401675d37124daaef3..b5727d69e6e63eea27dab1c6ae674a022bdeefb2 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -19,7 +19,7 @@ perfdhcp_tests = executable(
     'stats_mgr_unittest.cc',
     'test_control_unittest.cc',
     cpp_args: [f'-DTEST_DATA_DIR="@current_source_dir@/testdata"'],
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [perfdhcp_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index 294819cbd1ae55d60f2caa80fc3101d9ca5b965f..10cc7b4231169b2e06c12f36f5577170b79bce72 100644 (file)
@@ -1,4 +1,4 @@
-if SHELL_OPT != 'enabled'
+if not SHELL_OPT.enabled()
     subdir_done()
 endif
 
index 393c99946c07e277a82bd30a35bc8b5a06d0de7e..9df914e2ef0137bf9be6f9d662084dfc3185f405 100644 (file)
@@ -1,8 +1,7 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
-
 shell_tests_conf_data = configuration_data()
 shell_tests_conf_data.set('PYTHON', PYTHON.full_path())
 shell_tests_conf_data.set('abs_top_builddir', TOP_BUILD_DIR)
index c0e2edc821ba03949892167826d036c44baff8cc..d570cb80b434a2632cca11508a48bc5fed927e19 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -11,7 +11,7 @@ ddns_gss_tsig_libloadtests = executable(
         f'-DTEST_DATA_BUILDDIR="@current_source_dir@"',
         f'-DLIBDHCP_GSS_TSIG_SO="@TOP_BUILD_DIR@/src/hooks/d2/gss_tsig/libddns_gss_tsig.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index d8a90d53fded95898998bfa9aaf7f14c5b7ba8c6..6a1932bb7477673d7ab5ac7475920cfec1ff00c9 100644 (file)
@@ -1,4 +1,4 @@
-if not krb5.found()
+if not KRB5_DEP.found()
     subdir_done()
 endif
 
@@ -15,7 +15,7 @@ ddns_gss_tsig_lib = shared_library(
     'managed_key.cc',
     'tkey_exchange.cc',
     'version.cc',
-    dependencies: [krb5, crypto],
+    dependencies: [KRB5_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index 76e5beebc7e2bc8f7e280125f013bb4e20a60bc3..d75579e4dbca2785de7c81b5a2fc6493e4436720 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found() or not krb5.found()
+if not TESTS_OPT.enabled() or not KRB5_DEP.found()
     subdir_done()
 endif
 
@@ -23,7 +23,7 @@ ddns_gss_tsig_tests = executable(
     'tkey_exchange_unittests.cc',
     'tkey_unittests.cc',
     cpp_args: [f'-DTEST_DATA_DIR="@current_source_dir@"'],
-    dependencies: [krb5, gtest, crypto],
+    dependencies: [KRB5_DEP, GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [ddns_gss_tsig_tests_libs] + LIBS_BUILT_SO_FAR,
 )
@@ -33,7 +33,7 @@ executable(
     'nsupdate',
     'nsupdate.cc',
     cpp_args: [f'-DTEST_DATA_DIR="@current_source_dir@"'],
-    dependencies: [krb5],
+    dependencies: [KRB5_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [ddns_gss_tsig_archive] + LIBS_BUILT_SO_FAR,
 )
index ab9ab20ca7c7127fe259ab8a4e59aa85d93a8d98..d91e8231a62b9eaa10cc551734144a20743e446a 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -7,6 +7,6 @@ ddns_gss_tsig_testutils_lib = static_library(
     'ddns-gss-tsig-testutils',
     'gss_tsig_dns_server.cc',
     cpp_args: [f'-DTEST_DATA_DIR="@current_source_dir@"'],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
 )
index 49b7b228d83398bd2b9e65fd65fc230118f8b5db..9f92bcb9620f3333ce574399ff9ab935a3672e6d 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -9,7 +9,7 @@ dhcp_bootp_libload_tests = executable(
     cpp_args: [
         f'-DLIBDHCP_BOOTP_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/bootp/libdhcp_bootp.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index efa912066e79ae8ea90d68e258c5201e6837aa89..bd42fdd3be3c5216b2bab680359e177271e54b13 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -9,7 +9,7 @@ dhcp_bootp_lib_tests = executable(
     cpp_args: [
         f'-DBOOTP_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/bootp/libdhcp_bootp.so"',
     ],
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_bootp_archive] + LIBS_BUILT_SO_FAR,
 )
index 25c2d609604ea124845785a7e41977b6656115f9..17b95eb480420a66fc94f58b6949c8a5579e4f1c 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -9,7 +9,7 @@ dhcp_class_cmds_libloadtests = executable(
     cpp_args: [
         f'-DLIBDHCP_CLASS_CMDS_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/class_cmds/libdhcp_class_cmds.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index 4c3d82c7a330a60918d0916d341c0c0b721aed36..4a569934e1bbf7dff8ec873353390fa376fc9edf 100644 (file)
@@ -5,7 +5,7 @@ dhcp_class_cmds_lib = shared_library(
     'class_cmds_log.cc',
     'class_cmds_messages.cc',
     'version.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index 4869c0a4e02b5efab38e1d5de88eca12f1b3c99e..c7c026c0130d7961b040021615c7ebfeadddabdc 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -6,7 +6,7 @@ dhcp_class_cmds_tests = executable(
     'dhcp-class-cmds-tests',
     'class_cmds_unittest.cc',
     'run_unittests.cc',
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_class_cmds_archive] + LIBS_BUILT_SO_FAR,
 )
index e83b1591c0347644bfa19175d268a6059195ddf9..b0b6a2cf180a2f2ca2178ebcbe19fc09f8bb8039 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -12,7 +12,7 @@ dhcp_ddns_tuning_libloadtests = executable(
     cpp_args: [
         f'-DDDNS_TUNING_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/ddns_tuning/libdhcp_ddns_tuning.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index c25010c94f7c7b05ca3b7e900413b4204b783f96..e8e2a3f5a0de4dde42dc99334bab6f5b2dc6b9f3 100644 (file)
@@ -6,7 +6,7 @@ dhcp_ddns_tuning_lib = shared_library(
     'ddns_tuning_messages.cc',
     'expression_cache.cc',
     'version.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index 45fc91e902d8e97682f9105a9ea0d9711194c2b9..9e4e700e42d05d56349303f341c978a3c2f09307 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -7,7 +7,7 @@ dhcp_ddns_tuning_tests = executable(
     'ddns_tuning_unittests.cc',
     'expression_cache_unittests.cc',
     'run_unittests.cc',
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_ddns_tuning_archive] + LIBS_BUILT_SO_FAR,
 )
index 8e5a7376102a9041513af3ea12090ca42175033a..997c9fad1f5c9bace6fb7cbc0bb0a6abafbf8bb3 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -11,7 +11,7 @@ dhcp_flex_id_libloadtests = executable(
         f'-DTEST_DATA_BUILDDIR="@current_build_dir@"',
         f'-DLIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/flex_id/libdhcp_flex_id.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index b8fb90bf1e39adf8a6d21bc9bfd125aa2e3789d5..95d38a8fe18da7b74fdf83993c548e1e91f25f68 100644 (file)
@@ -5,7 +5,7 @@ dhcp_flex_id_lib = shared_library(
     'flex_id_messages.cc',
     'load_unload.cc',
     'version.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index f696468f22b036198e4938c47332ffec26df6b1a..03f88446dbe6bc1b191563889addd7fd02e86523 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -8,7 +8,7 @@ dhcp_flex_id_tests = executable(
     'callout_unittests.cc',
     'run_unittests.cc',
     cpp_args: [f'-DTEST_DATA_BUILDDIR="@current_build_dir@"'],
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_flex_id_archive] + LIBS_BUILT_SO_FAR,
 )
index 8c36cc2ab2550ba0ca82f099647dd4276db4e22e..c2c69cdf44c63c6ab9f190566c4ded49a747f0b4 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -10,7 +10,7 @@ dhcp_flex_option_libload_tests = executable(
     cpp_args: [
         f'-DFLEX_OPTION_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/flex_option/libdhcp_flex_option.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index d0a34b1958627fbc3247a075a68bbf0235e8bf92..dc8c0d2665cf8fc5bfdadd66166fec47d772c310 100644 (file)
@@ -5,7 +5,7 @@ dhcp_flex_option_lib = shared_library(
     'flex_option_log.cc',
     'flex_option_messages.cc',
     'version.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index 8d67b45a85f243fc073c561dbb4752e2ffcb73cc..da0c58c43e718e0d374585f725ae627768e1962a 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -10,7 +10,7 @@ dhcp_flex_option_lib_tests = executable(
     cpp_args: [
         f'-DFLEX_OPTION_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/flex_option/libdhcp_flex_option.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_flex_option_archive] + LIBS_BUILT_SO_FAR,
 )
index 6b454e699a948d7b70257289d05440c5a6c6e4a7..ee1c7b8d1616aaa055e8a246c81116e7e9df669a 100644 (file)
@@ -1,19 +1,19 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
 current_build_dir = meson.current_build_dir()
 link_with = [kea_database_testutils_lib]
 
-dependencies = [gtest, crypto]
+dependencies = [GTEST_DEP, CRYPTO_DEP]
 
-if mysql.found()
-    dependencies += [mysql]
+if MYSQL_DEP.found()
+    dependencies += [MYSQL_DEP]
     link_with += [dhcp_mysql_lib, kea_mysql_testutils_lib]
 endif
 
-if postgresql.found()
-    dependencies += [postgresql]
+if POSTGRESQL_DEP.found()
+    dependencies += [POSTGRESQL_DEP]
     link_with += [dhcp_pgsql_lib, kea_pgsql_testutils_lib]
 endif
 
@@ -26,7 +26,11 @@ dhcp_forensic_log_libloadtests = executable(
         f'-DLEGAL_LOG_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/forensic_log/libdhcp_legal_log.so"',
     ],
     dependencies: dependencies,
-    include_directories: [include_directories('.'), include_directories('..'), include_directories('../..')] + INCLUDES,
+    include_directories: [
+        include_directories('.'),
+        include_directories('..'),
+        include_directories('../..'),
+    ] + INCLUDES,
     link_with: [link_with] + LIBS_BUILT_SO_FAR,
 )
 
index 3bccdd8e40d376456ac993de0edd1582d980f340..0f2693fa68741aa161972c11ad63679cbbb3b6e6 100644 (file)
@@ -9,7 +9,7 @@ dhcp_forensic_log_lib = shared_library(
     'rotating_file.cc',
     'version.cc',
     cpp_args: [f'-DLEGAL_LOG_DIR="@LEGAL_LOG_DIR@"'],
-    dependencies: [crypto, mysql, postgresql],
+    dependencies: [CRYPTO_DEP, MYSQL_DEP, POSTGRESQL_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index e82810f168d46ce704f5a57137ffa848c8c866d9..0964e21edaf14df2225b43852d3a94ab61311e82 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -15,7 +15,7 @@ configure_file(
 
 current_build_dir = meson.current_build_dir()
 
-dependencies = [gtest, crypto]
+dependencies = [GTEST_DEP, CRYPTO_DEP]
 
 dhcp_forensic_log_tests_libs = [
     dhcp_forensic_log_archive,
index 5ed9dc885deb2bc6042b3046ba8e1cef07e858bd..57114f687b84feb967cbaac1182f7a15564d231e 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -10,7 +10,7 @@ dhcp_ha_libload_tests = executable(
     cpp_args: [
         f'-DLIBDHCP_HA_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/high_availability/libdhcp_ha.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index 93eb4d831b1710b4aceecad44dc49bca08e2dcf4..df0d5edd3741370c1c38b5a209c021fc893ea0d8 100644 (file)
@@ -14,7 +14,7 @@ dhcp_ha_lib = shared_library(
     'lease_update_backlog.cc',
     'query_filter.cc',
     'version.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index 70e38f750567f4af80096c24f43d47862d0b79d9..5665dff4a4796c28241f8e5b510142de3f74644b 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -21,7 +21,7 @@ dhcp_ha_lib_tests = executable(
         f'-DTEST_CA_DIR="@TEST_CA_DIR@"',
         f'-DTEST_HTTP_DIR="@TOP_SOURCE_DIR@/src/lib/http/tests/testdata"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_ha_archive, [kea_testutils_lib]] + LIBS_BUILT_SO_FAR,
 )
index 7574a58fce3146ef2b3b0a806eed2898b4051a85..a4951124833164d4c3ab7a1b20a6324a1e47f891 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -11,7 +11,7 @@ dhcp_host_cache_libloadtests = executable(
         f'-DTEST_DATA_BUILDDIR="@current_build_dir@"',
         f'-DLIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/host_cache/libdhcp_host_cache.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index 9584c29fa851148e6e734503b108b1b19de05206..b8e520176b1089c142f5ba61b4b63fc9a1582394 100644 (file)
@@ -8,7 +8,7 @@ dhcp_host_cache_lib = shared_library(
     'host_cache_messages.cc',
     'host_cache_parsers.cc',
     'version.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index ea3b9a6754c97e2ba5bccf3abf4a17f3399f6cec..9a2ab56e38e78336001cc2a2b4ff12aeadbb2107 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -15,7 +15,7 @@ dhcp_host_cache_tests = executable(
     'host_data_source_unittests.cc',
     'run_unittests.cc',
     cpp_args: [f'-DTEST_DATA_BUILDDIR="@current_build_dir@"'],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_host_cache_tests_libs] + LIBS_BUILT_SO_FAR,
 )
index 07db8cc0f7f923adfefabde7774eb532c7f2b603..0ac17168411df530191a4e6922a30802c6383565 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -9,7 +9,7 @@ dhcp_host_cmds_libloadtests = executable(
     cpp_args: [
         f'-DLIBDHCP_HOST_CMDS_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/host_cmds/libdhcp_host_cmds.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index d14900e37d2c2e3d4a0ac1084cee4bdffefeef6b..b140407f35024c493184a7a0cf4c9e21d15c01f5 100644 (file)
@@ -5,7 +5,7 @@ dhcp_host_cmds_lib = shared_library(
     'host_cmds_log.cc',
     'host_cmds_messages.cc',
     'version.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index de1f50b95e70dad2c23b2e57d1c33d977f415a54..ec4db6e4057543362e0f0afed13cb5aa8e3b3953 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -8,7 +8,7 @@ dhcp_host_cmds_tests = executable(
     'host_cmds_unittest.cc',
     'host_data_parser_unittest.cc',
     'run_unittests.cc',
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_host_cmds_tests_libs] + LIBS_BUILT_SO_FAR,
 )
index 703e0d0bdb55957ce2f75df52f42168c8f5be498..6cb9cf966abe0c6f40831dbe804b1bb61eae3afe 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -12,7 +12,7 @@ dhcp_lease_cmds_libload_tests = executable(
     cpp_args: [
         f'-DLIBDHCP_LEASE_CMDS_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/lease_cmds/libdhcp_lease_cmds.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index 6fa6fbd7b08a1c320c17d9835bea0a3b6a6bb950..d2701aa8e9ef7dfd094d576c76e4764f2bccf37b 100644 (file)
@@ -7,7 +7,7 @@ dhcp_lease_cmds_lib = shared_library(
     'lease_cmds_messages.cc',
     'lease_parser.cc',
     'version.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index f36103388cf86db600f71ebaeed8f6a70d4cb73e..a104572e6769220c81552f67a8ef131f3d6ee5b4 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -8,7 +8,7 @@ dhcp_lease_cmds_lib_tests = executable(
     'lease_cmds_func4_unittest.cc',
     'lease_cmds_func6_unittest.cc',
     'run_unittests.cc',
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_lease_cmds_archive] + LIBS_BUILT_SO_FAR,
 )
index e50400a029114046dc1cc1f909b60d602a36870b..c27818439be6506e4268c930f87661a0c506f56b 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -11,7 +11,7 @@ dhcp_lease_query_libloadtests = executable(
         f'-DTEST_DATA_BUILDDIR="@current_build_dir@"',
         f'-DLIBDHCP_LEASE_QUERY_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/lease_query/libdhcp_lease_query.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index 485d23eb4afd3101f904a897fbf773cdc1cedaad..95c7f188489279b61dc6fbdf992df7895d0ec40e 100644 (file)
@@ -13,7 +13,7 @@ dhcp_lease_query_lib = shared_library(
     'lease_query_messages.cc',
     'mt_lease_query_mgr.cc',
     'version.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index 38833f35bf17dc0c4a66b3e48bd042ed1bcece03..48b6a8718add18a5d74a7ee2b9c084f6d8a65e1c 100644 (file)
@@ -1,17 +1,17 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
 current_build_dir = meson.current_build_dir()
-dhcp_lease_query_tests_dependencies = [gtest, crypto]
+dhcp_lease_query_tests_dependencies = [GTEST_DEP, CRYPTO_DEP]
 dhcp_lease_query_tests_libs = [dhcp_lease_query_archive]
-if mysql.found()
+if MYSQL_DEP.found()
     dhcp_lease_query_tests_libs += [dhcp_mysql_archive, kea_mysql_testutils_lib]
-    dhcp_lease_query_tests_dependencies += [mysql]
+    dhcp_lease_query_tests_dependencies += [MYSQL_DEP]
 endif
-if postgresql.found()
+if POSTGRESQL_DEP.found()
     dhcp_lease_query_tests_libs += [dhcp_pgsql_archive, kea_pgsql_testutils_lib]
-    dhcp_lease_query_tests_dependencies += [postgresql]
+    dhcp_lease_query_tests_dependencies += [POSTGRESQL_DEP]
 endif
 dhcp_lease_query_tests_libs += [
     kea_dhcp_testutils_lib,
index 079af19fa0b98af96d3aaca0e4a6eba206ffb0d2..e1458420b2a20426883e3dcabbeeeee13a766826 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -9,7 +9,7 @@ dhcp_limits_libloadtests = executable(
     cpp_args: [
         f'-DLIBDHCP_LIMITS_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/limits/libdhcp_limits.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index 935502bfc743fceb6cab61e6fff1891db5826fb1..d008af33ad9df829a169a2f012ca20d5c3c748af 100644 (file)
@@ -8,7 +8,7 @@ dhcp_limits_lib = shared_library(
     'limit_manager.cc',
     'load_unload.cc',
     'version.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index 7783f0f0852bb87449c7bee95a03db7ac17ac6a2..ec6d2eed79899d2013bc2e1e4fac70d7d976e74b 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -8,7 +8,7 @@ dhcp_limits_tests = executable(
     'limits_unit_tests_limit_manager.cc',
     'limits_unit_tests_main.cc',
     'limits_unit_tests_rate_limiting.cc',
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_limits_archive, kea_testutils_lib] + LIBS_BUILT_SO_FAR,
 )
index 83b70a2b828b5afab96bf39be499f662c58104e4..83fdf085a8054dcf20aebbff0867039fe1bf27aa 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -9,7 +9,7 @@ dhcp_mysql_libload_tests = executable(
     cpp_args: [
         f'-DLIBDHCP_MYSQL_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/mysql/libdhcp_mysql.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index b9c90295c6472a14af5b9b88a180cdcb2bee2087..e1f041555f3d895de7198ca08697aef3edc4f15d 100644 (file)
@@ -1,4 +1,4 @@
-if not mysql.found()
+if not MYSQL_DEP.found()
     subdir_done()
 endif
 
@@ -20,7 +20,7 @@ dhcp_mysql_lib = shared_library(
     'mysql_lease_mgr.cc',
     'mysql_legal_log.cc',
     'version.cc',
-    dependencies: [crypto, mysql],
+    dependencies: [CRYPTO_DEP, MYSQL_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index 3495f6a846be4f5afc1c045b4d22b903c947dfd8..816778168e453d8d53502858e984affce00bd755 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found() or not mysql.found()
+if not TESTS_OPT.enabled() or not MYSQL_DEP.found()
     subdir_done()
 endif
 
@@ -20,10 +20,8 @@ dhcp_mysql_lib_tests = executable(
     'mysql_lease_extended_info_unittest.cc',
     'mysql_lease_mgr_unittest.cc',
     'run_unittests.cc',
-    cpp_args: [
-        f'-DTEST_CA_DIR="@TEST_CA_DIR@"',
-    ],
-    dependencies: [gtest, crypto, mysql],
+    cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'],
+    dependencies: [GTEST_DEP, CRYPTO_DEP, MYSQL_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_mysql_archive, libs_testutils, kea_testutils_lib] + LIBS_BUILT_SO_FAR,
 )
index 44bd8efcd8b8578fe78ee37a1a4b5541682d98ac..b451d31b5b25b073e3f89828af71ef1d3ce75292 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -9,7 +9,7 @@ dhcp_perfmon_libload_tests = executable(
     cpp_args: [
         f'-DLIBDHCP_PERFMON_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/perfmon/libdhcp_perfmon.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index 4d8a60db92e91bdd879e99326f6df450904e5ecb..5a55675d2db096bd1ef881b5b457e26c6b95ab1c 100644 (file)
@@ -10,7 +10,7 @@ dhcp_perfmon_lib = shared_library(
     'perfmon_messages.cc',
     'perfmon_mgr.cc',
     'version.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index b575405e35e57168995b90a58e51b38f403d9ba4..fab0e5a5b8b2a13e6ce9b7425dfa275e24f8da00 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -15,7 +15,7 @@ dhcp_perfmon_lib_tests = executable(
     cpp_args: [
         f'-DPERFMON_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/perfmon/libdhcp_perfmon.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_perfmon_archive, [kea_testutils_lib]] + LIBS_BUILT_SO_FAR,
 )
index bbeb49b1f204054dbc5af711d0a1c3bdae787681..840680b4ec18d496c0dc55b598e5e79ecde1db0f 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -9,7 +9,7 @@ dhcp_pgsql_libload_tests = executable(
     cpp_args: [
         f'-DLIBDHCP_PGSQL_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/pgsql/libdhcp_pgsql.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index ec3611d384005d1ff130aa52421fd94c97d66725..c38e103eeac3e8ce9e7169a79b3e657d6fa1b2bb 100644 (file)
@@ -1,4 +1,4 @@
-if not postgresql.found()
+if not POSTGRESQL_DEP.found()
     subdir_done()
 endif
 
@@ -20,7 +20,7 @@ dhcp_pgsql_lib = shared_library(
     'pgsql_lease_mgr.cc',
     'pgsql_legal_log.cc',
     'version.cc',
-    dependencies: [crypto, postgresql],
+    dependencies: [CRYPTO_DEP, POSTGRESQL_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index 775e43c4b1ea9b785b1018a645981ada9826fb76..36716c62102dd5468bc9885c289e6d7d53c6b2a8 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found() or not postgresql.found()
+if not TESTS_OPT.enabled() or not POSTGRESQL_DEP.found()
     subdir_done()
 endif
 
@@ -20,7 +20,7 @@ dhcp_pgsql_lib_tests = executable(
     'pgsql_lease_extended_info_unittest.cc',
     'pgsql_lease_mgr_unittest.cc',
     'run_unittests.cc',
-    dependencies: [gtest, crypto, postgresql],
+    dependencies: [GTEST_DEP, CRYPTO_DEP, POSTGRESQL_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_pgsql_archive, libs_testutils, kea_testutils_lib] + LIBS_BUILT_SO_FAR,
 )
index a5c607eae9eda1292c9f4eea1645dab9eec97175..da8bf439c0570f6a582cda318b958566e50c793d 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -9,7 +9,7 @@ dhcp_ping_check_libloadtests = executable(
     cpp_args: [
         f'-DPING_CHECK_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/ping_check/libdhcp_ping_check.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index 5245d9de1741a19ec319cf7a65a27f7e93089d8d..320d6be7e138614e77f89f0b5454513400d4de93 100644 (file)
@@ -11,7 +11,7 @@ dhcp_ping_check_lib = shared_library(
     'ping_context.cc',
     'ping_context_store.cc',
     'version.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index 1075a960ef696b12d667ddd650fc15a280f91e60..8beca7813e184e0489d30db094fa44f8bd0e4f8e 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -14,7 +14,7 @@ dhcp_ping_check_tests = executable(
     'ping_context_store_unittests.cc',
     'ping_context_unittests.cc',
     'run_unittests.cc',
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_ping_check_archive] + LIBS_BUILT_SO_FAR,
 )
index 5627f61836ccc607ef142fb820f65d604224061f..9514cea7e9fb44ca7419fff60309b2705efc3893 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -11,7 +11,7 @@ dhcp_radius_libloadtests = executable(
         f'-DLIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/radius/libdhcp_radius.so"',
         f'-DTEST_DICTIONARY="@TOP_SOURCE_DIR@/src/hooks/dhcp/radius/data/dictionary"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index c0dd0e01ff583cf95b123af0a0bf8c9a90179ce8..30b1b124fd254ffbba857831439dad92d22b7c42 100644 (file)
@@ -26,7 +26,7 @@ dhcp_radius_lib = shared_library(
     'radius_utils.cc',
     'version.cc',
     cpp_args: [f'-DDICTIONARY="@PREFIX@/@SYSCONFDIR@/kea/radius/dictionary"'],
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index 9d0d9805c83d4efd36d357e69c2b044e3f27469a..3a20e763ae8a94b1e926eeb0b0164454b6acd43c 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -30,7 +30,7 @@ dhcp_radius_tests = executable(
         f'-DDICTIONARY="@PREFIX@/@SYSCONFDIR@/kea/radius/dictionary"',
         f'-DTEST_DICTIONARY="@TOP_SOURCE_DIR@/src/hooks/dhcp/radius/data/dictionary"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_radius_tests_libs] + LIBS_BUILT_SO_FAR,
 )
index 368b76aa2b00edfa03dc1acb1c1ab21f0fedbfb5..59b53c350cc51d3f294fd8cd04498aa9dbad3ce7 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 hook_includes = [include_directories('..')]
@@ -10,7 +10,7 @@ dhcp_run_script_libload_tests = executable(
         f'-DLIBRUN_SCRIPT_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/run_script/libdhcp_run_script.so"',
         f'-DRUN_SCRIPT_TEST_SH="@TOP_BUILD_DIR@/src/hooks/dhcp/run_script/tests/run_script_test.sh"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index 30c7c8495590cf40dea28c6c7ff9fce72868b1b1..8dc26670340d3f60cc14adab88c609faecc31052 100644 (file)
@@ -5,7 +5,7 @@ dhcp_run_script_lib = shared_library(
     'run_script_log.cc',
     'run_script_messages.cc',
     'version.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index c0e5541e0dfb0afd957c7108c09f18b02bbcb680..55f1296d042430fccbf67d8574d5b30bc91a3b06 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -20,7 +20,7 @@ dhcp_run_script_lib_tests = executable(
         f'-DTEST_LOG_FILE="@current_build_dir@/test.log"',
         f'-DRUN_SCRIPT_TEST_SH="@current_build_dir@/run_script_test.sh"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_run_script_archive] + LIBS_BUILT_SO_FAR,
 )
index dfdee11bfc5f2822dfaefe848e116f6e4c4b6c03..260d871ea3676972701fcb68d76c1d5d30cd890a 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -9,7 +9,7 @@ dhcp_stat_cmds_libload_tests = executable(
     cpp_args: [
         f'-DLIBDHCP_STAT_CMDS_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/stat_cmds/libdhcp_stat_cmds.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index a43d130d3ba4e744f17bb84a034507ce5ff5daf9..7de7423dbc7305304c51852ee94ad2827df4ce02 100644 (file)
@@ -5,7 +5,7 @@ dhcp_stat_cmds_lib = shared_library(
     'stat_cmds_log.cc',
     'stat_cmds_messages.cc',
     'version.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index 56002a58966c0a42116d99bb978b518703d93ffe..8ae3289a7a70e1b79f911a9f51f36eaccf80c65d 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -9,7 +9,7 @@ dhcp_stat_cmds_lib_tests = executable(
     cpp_args: [
         f'-DSTAT_CMDS_LIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/stat_cmds/libdhcp_stat_cmds.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_stat_cmds_archive] + LIBS_BUILT_SO_FAR,
 )
index f00b1f81929e9e1e0376c23689645c5e219438d3..154de07935f1b7c65f15e0e81d8d07ea4a0f9bd0 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -9,7 +9,7 @@ dhcp_subnet_cmds_libloadtests = executable(
     cpp_args: [
         f'-DLIBDHCP_SUBNET_CMDS_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/subnet_cmds/libdhcp_subnet_cmds.so"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index 5c13a65a1fe0b20b571285c30afda754417540af..f24fcb40e4609795e4f5ecb92a6da22053d602fb 100644 (file)
@@ -5,7 +5,7 @@ dhcp_subnet_cmds_lib = shared_library(
     'subnet_cmds_log.cc',
     'subnet_cmds_messages.cc',
     'version.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib/kea/hooks',
index ad53609f88ea7f6a8ef75acd3963275e933fdeae..35cb6935f4687601b970b8e97dfa113c64bbc577 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -13,7 +13,7 @@ dhcp_subnet_cmds_tests = executable(
     cpp_args: [
         f'-DLIB_SO="@TOP_BUILD_DIR@/src/hooks/dhcp/subnet_cmds/libdhcp_subnet_cmds.so"',
     ],
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_subnet_cmds_tests_libs] + LIBS_BUILT_SO_FAR,
 )
index d37bf0220264513be72465dc769ed942d08bf26e..c59dfdc157f9fb00f4b481aca5c857eb1bdd8ab6 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -19,7 +19,7 @@ dhcp_user_chk_lib_tests = executable(
     'user_unittests.cc',
     'userid_unittests.cc',
     cpp_args: [f'-DTEST_DATA_BUILDDIR="@current_build_dir@"'],
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.'), include_directories('..')] + INCLUDES,
     link_with: [dhcp_user_chk_archive] + LIBS_BUILT_SO_FAR,
 )
index a572aec8d8f71a3a04fa7302d052ee6313c2e14c..a1068c7d48c66d519dc24fab912004e646a4d3fe 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -6,7 +6,7 @@ kea_asiodns_tests = executable(
     'kea-asiodns-tests',
     'io_fetch_unittest.cc',
     'run_unittests.cc',
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_testutils_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index bb20eb21198348b02acf7e785ab290f970d80410..57f4d5c22b5c713bb37c188fe5bdf6e9aa02fa7a 100644 (file)
@@ -14,7 +14,7 @@ kea_asiolink_lib = shared_library(
     'openssl_tls.cc',
     'process_spawn.cc',
     'unix_domain_socket.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib',
index e90aa9001a870006f08e2eb224e053a7bf3d9f00..4bc325a06c1f6e70a31cfc7125ccffe9a2ecda01 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -37,7 +37,7 @@ kea_asiolink_tests = executable(
         f'-DINVALID_TEST_SCRIPT_SH="@TOP_SOURCE_DIR@/README"',
         f'-DTEST_CA_DIR="@TEST_CA_DIR@"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_asiolink_testutils_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index 49c1fb78877440ad466a46724cc71f78584b44f5..4e6a050c09561ed2c90863bd8fc6074e4085a237 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -8,16 +8,16 @@ kea_asiolink_testutils_lib = static_library(
     'test_server_unix_socket.cc',
     'timed_signal.cc',
     cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'],
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
 )
 
-if crypto.name() == openssl.name()
+if CRYPTO_DEP.name() == openssl.name()
     executable(
         'openssl_sample_client',
         'openssl_sample_client.cc',
         cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'],
-        dependencies: [gtest, openssl],
+        dependencies: [GTEST_DEP, openssl],
         include_directories: [include_directories('.')] + INCLUDES,
         link_with: LIBS_BUILT_SO_FAR,
     )
@@ -25,16 +25,16 @@ if crypto.name() == openssl.name()
         'openssl_sample_server',
         'openssl_sample_server.cc',
         cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'],
-        dependencies: [gtest, openssl],
+        dependencies: [GTEST_DEP, openssl],
         include_directories: [include_directories('.')] + INCLUDES,
         link_with: LIBS_BUILT_SO_FAR,
     )
-elif crypto.name() == botan.name()
+elif CRYPTO_DEP.name() == botan.name()
     executable(
         'botan_sample_client',
         'botan_sample_client.cc',
         cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'],
-        dependencies: [gtest, botan],
+        dependencies: [GTEST_DEP, botan],
         include_directories: [include_directories('.')] + INCLUDES,
         link_with: LIBS_BUILT_SO_FAR,
     )
@@ -42,7 +42,7 @@ elif crypto.name() == botan.name()
         'botan_sample_server',
         'botan_sample_server.cc',
         cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'],
-        dependencies: [gtest, botan],
+        dependencies: [GTEST_DEP, botan],
         include_directories: [include_directories('.')] + INCLUDES,
         link_with: LIBS_BUILT_SO_FAR,
     )
index b7a925a244c05774464d59096a782d5e6e007e2c..b59ddd6ce434893625922e7db7ba3b7e0df326b8 100644 (file)
@@ -1,5 +1,5 @@
 kea_cc_lib_cpp_args = []
-if gtest.found()
+if TESTS_OPT.enabled()
     kea_cc_lib_cpp_args = ['-DALLOW_KEATEST']
 endif
 kea_cc_lib = shared_library(
index d2c2ce18c9ed29a80b4da49476fb8e583a58dc5c..07a2f8f5f0499f87df08ec090d04db6d05ed477f 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -15,7 +15,7 @@ kea_cc_tests = executable(
     'stamped_element_unittest.cc',
     'stamped_value_unittest.cc',
     'user_context_unittests.cc',
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index 6e04771c321b533ad669076f8dc31a36d2905cb8..fcb7c9480021bb3fd156d5091e5072457a774378 100644 (file)
@@ -13,7 +13,7 @@ kea_config_lib = shared_library(
     'http_command_response_creator.cc',
     'unix_command_config.cc',
     'unix_command_mgr.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib',
index 3d6122e7bf4774a229528e42c469297a45fda679..276f21cb03648e8dd998c587116a72e7a711ea71 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -18,7 +18,7 @@ kea_config_tests = executable(
     'run_unittests.cc',
     'unix_command_config_unittests.cc',
     'unix_command_mgr_unittests.cc',
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     cpp_args: [
         f'-DTEST_DATA_BUILDDIR="@current_build_dir@"',
         f'-DTEST_CA_DIR="@TEST_CA_DIR@"',
index b631319233a10a3720e78c32f34bd86b06e64eeb..b43544e9ad7ca450bad4d55832feb6f9e412c987 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -6,7 +6,7 @@ kea_config_backend_tests = executable(
     'kea-config_backend-tests',
     'config_backend_mgr_unittest.cc',
     'run_unittests.cc',
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_testutils_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index 969ee365e5f3b346296c1d83975688049929721b..bb6513c702b323659f76e6d150533c8649c84ea1 100644 (file)
@@ -1,7 +1,7 @@
 sources = []
-if crypto.name() == botan.name()
+if CRYPTO_DEP.name() == botan.name()
     sources += ['botan_hash.cc', 'botan_hmac.cc', 'botan_link.cc']
-elif crypto.name() == openssl.name()
+elif CRYPTO_DEP.name() == openssl.name()
     sources += ['openssl_hash.cc', 'openssl_hmac.cc', 'openssl_link.cc']
 endif
 
@@ -12,7 +12,7 @@ kea_cryptolink_lib = shared_library(
     'crypto_hmac.cc',
     'crypto_rng.cc',
     sources,
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib',
index 7dca395f576f9d07608e8f2bc1e422458641b81f..e05fe7efd7cae22c1dfb4266852b3dfc56afb5dc 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -8,7 +8,7 @@ kea_cryptolink_tests = executable(
     'hash_unittests.cc',
     'hmac_unittests.cc',
     'run_unittests.cc',
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index 71089330245092ead8754bd9cb1a702445e05f3b..564d26b4b4fb89cc89b556b78c5a6b1126149de0 100644 (file)
@@ -11,7 +11,7 @@ kea_d2srv_lib = shared_library(
     'd2_zone.cc',
     'dns_client.cc',
     'nc_trans.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib',
index ea0ed7e2428987c55748befe0d06ac3b40ee36d8..e2fafa493377e3e8d2341f642fd5ea44a36fc700 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -11,7 +11,7 @@ kea_d2srv_tests = executable(
     'd2_zone_unittests.cc',
     'dns_client_unittests.cc',
     'nc_trans_unittests.cc',
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib, libs_testutils] + LIBS_BUILT_SO_FAR,
 )
index 6cfd0720b87eebe2afcbb177436bd367cda56f1d..06065a04fa7867b9b315bfc9a3e220cdec04a751 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -6,6 +6,6 @@ kea_d2srv_testutils_lib = static_library(
     'kea-d2srv-testutils',
     'nc_test_utils.cc',
     'stats_test_utils.cc',
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
 )
index 5f8e86833b2c39043d9399b8537f5b98dd1667eb..1f9a4649e7f1366baaad9488018a2578eebd72de 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -12,7 +12,7 @@ kea_database_tests = executable(
     'run_unittests.cc',
     'server_selector_unittest.cc',
     'server_unittest.cc',
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_testutils_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index 8390b6ca7f40ef5304057ef61a363e0bba942a95..f11417a4d739c93a8646be0dd3485cdfbf667ab0 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -6,6 +6,6 @@ kea_database_testutils_lib = static_library(
     'kea-database-testutils',
     'schema.cc',
     cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'],
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
 )
index 2980fe56e796d213e6296d9afb1a48449518b69e..3df8728dde194968de74acc06a1ccd5e81e25255 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -61,7 +61,7 @@ kea_dhcp_tests = executable(
     'protocol_util_unittest.cc',
     'run_unittests.cc',
     pkt_filter_xpf_unittest_cc,
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     cpp_args: [f'-DTEST_DATA_BUILDDIR="@current_build_dir@"'],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib, libs_testutils] + LIBS_BUILT_SO_FAR,
index ad77e49fa558bd6b4a45d45503bca22d353955b2..74fba554c4fe147bcceb6b70fa605b1afca79562 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -9,6 +9,6 @@ kea_dhcp_testutils_lib = static_library(
     'pkt_captures6.cc',
     'pkt_filter6_test_stub.cc',
     'pkt_filter_test_stub.cc',
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
 )
index 8d343aa8d5df8850bfd3666ca794aaab1ffe558a..6b3d2bf06fb2b3ffcc1e60c524346f583b830377 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -8,7 +8,7 @@ kea_dhcp_ddns_tests = executable(
     'ncr_unittests.cc',
     'run_unittests.cc',
     'test_utils.cc',
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_testutils_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index e5e1ee2dd32be82eecd85d7e06e4d69b771a86e0..46fae580ee54bb8e9fabd67a4bc7b9dd2fabe90d 100644 (file)
@@ -92,7 +92,7 @@ kea_dhcpsrv_lib = shared_library(
         f'-DDHCP_DATA_DIR="@DHCP_DATA_DIR@"',
         f'-DKEA_LFC_EXECUTABLE="@KEA_LFC@"',
     ],
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib',
index 41e7c402f54e5c1afc312c99679fbc5e5395ea15..3557286336c7703b036b418052efa3c11d4c438f 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -128,7 +128,7 @@ kea_dhcpsrv_tests = executable(
         f'-DKEA_LFC_BUILD_DIR="@TOP_BUILD_DIR@/src/bin/lfc"',
         f'-DDEFAULT_HOOKS_PATH="@DEFAULT_HOOKS_PATH@"',
     ],
-    dependencies: [crypto, gtest],
+    dependencies: [CRYPTO_DEP, GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib, libs_testutils] + LIBS_BUILT_SO_FAR,
 )
index 00aac1dbbb8b6ca99b6077667ca6163e4cf26f28..c0b5c5702715a4c8f4191ecd2549743722ce763e 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -20,14 +20,14 @@ sources = [
     'test_config_backend_dhcp6.cc',
     'test_utils.cc',
 ]
-dependencies = [crypto, gtest]
-if mysql.found()
+dependencies = [CRYPTO_DEP, GTEST_DEP]
+if MYSQL_DEP.found()
     sources += ['mysql_generic_backend_unittest.cc']
-    dependencies += [mysql]
+    dependencies += [MYSQL_DEP]
 endif
-if postgresql.found()
+if POSTGRESQL_DEP.found()
     sources += ['pgsql_generic_backend_unittest.cc']
-    dependencies += [postgresql]
+    dependencies += [POSTGRESQL_DEP]
 endif
 kea_dhcpsrv_testutils_lib = static_library(
     'kea-dhcpsrv-testutils',
index 70c6502c0d5878df4a97d1a0ee71d5811548b1a8..eb1021567e72a5b170279fed9690b1ad1238c8f0 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -50,7 +50,7 @@ kea_dns_tests = executable(
         f'-DTEST_DATA_BUILDDIR="@TOP_BUILD_DIR@/src/lib/dns/tests/testdata"',
         f'-DTEST_DATA_SRCDIR="@TOP_SOURCE_DIR@/src/lib/dns/tests/testdata"',
     ],
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index b603884768a2aadeafa14977d7ae3af40eb2694e..f020ac0b305d1cf60e94b8bdf5b868e9be867ba1 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -10,7 +10,7 @@ kea_eval_tests = executable(
     'evaluate_unittest.cc',
     'run_unittests.cc',
     'token_unittest.cc',
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_testutils_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index b8432129f9964670b8b3b8607cc57341a7fa7377..788e52adc474a95a9e8c130ffb46d75e9e5780f3 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -6,7 +6,7 @@ kea_exceptions_tests = executable(
     'kea-exceptions-tests',
     'exceptions_unittest.cc',
     'run_unittests.cc',
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: LIBS_BUILT_SO_FAR,
 )
index fa32e2444d06ccd56e3d99745b48d29a9d8ede01..eb56f8e36cdd3c0ce881d05ed3ddb5bca7cf9c3e 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -110,7 +110,7 @@ kea_hooks_tests = executable(
     'parking_lots_unittest.cc',
     'run_unittests.cc',
     'server_hooks_unittest.cc',
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index 43f168f80b8bd6f665b7882c8c5cdc42256baa5e..c8576cb31558109065a24a2fa9ada3dbbac747d7 100644 (file)
@@ -25,7 +25,7 @@ kea_http_lib = shared_library(
     'response_json.cc',
     'response_parser.cc',
     'url.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib',
index aca510d0d0e2b126cccee909e15bf8182e288c74..86a6565236c096f82793e2e4491176f7d55403c7 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -30,7 +30,7 @@ kea_http_tests = executable(
         f'-DTEST_CA_DIR="@TEST_CA_DIR@"',
         f'-DDATA_DIR="@current_source_dir@/testdata"',
     ],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib, libs_testutils] + LIBS_BUILT_SO_FAR,
 )
index c0f0b1d00c9747ed891b41e3592938b42c2edd40..0381d60cb6019e83307e6ec4e20d6a66a021e41c 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -8,7 +8,7 @@ kea_log_interprocess_tests = executable(
     'interprocess_sync_null_unittest.cc',
     'run_unittests.cc',
     cpp_args: [f'-DTEST_DATA_TOPBUILDDIR="@TOP_BUILD_DIR@"'],
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index a53333f0d2b2e2978d0dce3ab4e543356c0a19cb..ae664362546393ca23b4fc38289c57f91a2314b8 100644 (file)
@@ -20,7 +20,7 @@ kea_log_lib = shared_library(
     'message_reader.cc',
     'output_option.cc',
     cpp_args: [f'-DTOP_BUILDDIR="@TOP_BUILD_DIR@"'],
-    dependencies: [log4cplus],
+    dependencies: [LOG4CPLUS_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib',
index 3409d51ec82722509cb936f953cb1f3e98a2556d..777fcfc698fb13ab13643f7adb0bfa9eb2b39e1c 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -19,7 +19,7 @@ kea_log_tests = executable(
     'output_option_unittest.cc',
     'run_unittests.cc',
     cpp_args: [f'-DTEMP_DIR="@TOP_BUILD_DIR@"'],
-    dependencies: [gtest, log4cplus],
+    dependencies: [GTEST_DEP, LOG4CPLUS_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
@@ -30,7 +30,7 @@ kea_log_init_tests = executable(
     'run_initializer_unittests.cc',
     'message_initializer_1_unittest.cc',
     'message_initializer_1a_unittest.cc',
-    dependencies: [gtest, log4cplus],
+    dependencies: [GTEST_DEP, LOG4CPLUS_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index a3984cc8183a3f658b45c0227cee8dc4b64971b3..7420bd139ed154cf6a0e6722b6f8241c6f312a24 100644 (file)
@@ -1,4 +1,4 @@
-if not mysql.found()
+if not MYSQL_DEP.found()
     subdir_done()
 endif
 
@@ -7,7 +7,7 @@ kea_mysql_lib = shared_library(
     'mysql_binding.cc',
     'mysql_connection.cc',
     cpp_args: [f'-DKEA_ADMIN="@KEA_ADMIN@"'],
-    dependencies: [mysql],
+    dependencies: [MYSQL_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib',
index 74b8be3aaf9767c0ab71a19f8eba3606ff8c58e1..9ee4081901f2736e6ad1857fd4adf0b7ccf77ac3 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found() or not mysql.found()
+if not TESTS_OPT.enabled() or not MYSQL_DEP.found()
     subdir_done()
 endif
 
@@ -13,7 +13,7 @@ kea_mysql_tests = executable(
     'mysql_connection_unittest.cc',
     'run_unittests.cc',
     cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"', f'-DKEA_ADMIN="@KEA_ADMIN@"'],
-    dependencies: [gtest, mysql],
+    dependencies: [GTEST_DEP, MYSQL_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib, libs_testutils] + LIBS_BUILT_SO_FAR,
 )
index 942b067e3d68d010a3fc00f088b353491a8021bb..933b9dcdaad710534317ba8543baa95656276fc0 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found() or not mysql.found()
+if not TESTS_OPT.enabled() or not MYSQL_DEP.found()
     subdir_done()
 endif
 
@@ -9,6 +9,6 @@ kea_mysql_testutils_lib = static_library(
         f'-DDATABASE_SCRIPTS_DIR="@DATABASE_SCRIPTS_DIR@"',
         f'-DDATABASE_WIPE_DIR="@DATABASE_SCRIPTS_DIR@"',
     ],
-    dependencies: [gtest, mysql],
+    dependencies: [GTEST_DEP, MYSQL_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
 )
index daf1c8a0400810b196ad8e7ab1ead85f9d8ee080..644c2669e3cd8e5180f3fa12d2e9e17a4b48e027 100644 (file)
@@ -1,4 +1,4 @@
-if not postgresql.found()
+if not POSTGRESQL_DEP.found()
     subdir_done()
 endif
 
@@ -7,7 +7,7 @@ kea_pgsql_lib = shared_library(
     'pgsql_connection.cc',
     'pgsql_exchange.cc',
     cpp_args: [f'-DKEA_ADMIN="@KEA_ADMIN@"'],
-    dependencies: [postgresql],
+    dependencies: [POSTGRESQL_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib',
index 56ef940d246a9b5a2f2a33d78aeaf5c9abb54126..18ed926da4d6036f70963d685795c2b6972d6f04 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found() or not postgresql.found()
+if not TESTS_OPT.enabled() or not POSTGRESQL_DEP.found()
     subdir_done()
 endif
 
@@ -14,7 +14,7 @@ kea_pgsql_tests = executable(
     'pgsql_exchange_unittest.cc',
     'run_unittests.cc',
     cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"', f'-DKEA_ADMIN="@KEA_ADMIN@"'],
-    dependencies: [gtest, postgresql],
+    dependencies: [GTEST_DEP, POSTGRESQL_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib, libs_testutils] + LIBS_BUILT_SO_FAR,
 )
index 9966acc4928e6152e7ccf154b7893f4c2df4380e..8bc4c9c8da7f72b0c21d2131b679e5eae46a9627 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found() or not postgresql.found()
+if not TESTS_OPT.enabled() or not POSTGRESQL_DEP.found()
     subdir_done()
 endif
 
@@ -9,6 +9,6 @@ kea_pgsql_testutils_lib = static_library(
         f'-DDATABASE_SCRIPTS_DIR="@DATABASE_SCRIPTS_DIR@"',
         f'-DDATABASE_WIPE_DIR="@DATABASE_SCRIPTS_DIR@"',
     ],
-    dependencies: [gtest, postgresql],
+    dependencies: [GTEST_DEP, POSTGRESQL_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
 )
index 0cef9dc61650c089592f9d95fdd52a290869b537..29f6f2a90e0aaee48f56d765f81256a05adf6a1f 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -6,7 +6,7 @@ kea_process_cfgrpt_tests = executable(
     'kea-process-cfgrpt-tests',
     'config_report_unittests.cc',
     'run_unittests.cc',
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index 7b3c8966389447f3f073b0344847547b6ae51e15..a1f48887c450fb839bf27517713036622ecf4b09 100644 (file)
@@ -13,7 +13,7 @@ kea_process_lib = shared_library(
     'process_messages.cc',
     'redact_config.cc',
     cpp_args: [f'-DDATA_DIR="@DHCP_DATA_DIR@"'],
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib',
index dcf605506add5f3c39302650d40a518677cedeb2..4c6aecb7d8415a46ba9bb83b829f8f876a19af7e 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -21,7 +21,7 @@ kea_process_tests = executable(
     'log_parser_unittests.cc',
     'logging_info_unittests.cc',
     'run_unittests.cc',
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     cpp_args: [
         f'-DTEST_DATA_BUILDDIR="@current_build_dir@"',
         f'-DTEST_SCRIPT_SH="@current_build_dir@/process_test.sh"',
index cad4700a26724ac54bbe42501679c56544854955..c140a3f84174b364ce89c92dc3a8eec9aedad47c 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -6,6 +6,6 @@ kea_process_testutils_lib = static_library(
     'kea-process-testutils',
     'd_test_stubs.cc',
     cpp_args: [f'-DDATABASE_SCRIPTS_DIR="@DATABASE_SCRIPTS_DIR@"'],
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
 )
index dbba79be84ddc1564faf6b882ae87ff1dcb4506f..82a29c3be5418310028eefd5bfd7303fd1dc71bc 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -8,7 +8,7 @@ kea_stats_tests = executable(
     'observation_unittest.cc',
     'run_unittests.cc',
     'stats_mgr_unittest.cc',
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_testutils_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index 9c84af5ded285bf8f1559c74eea17c00dc6c89e8..0d615c7dd6877f53630f4a5b89b68b9bd8f42a93 100644 (file)
@@ -7,7 +7,7 @@ kea_tcp_lib = shared_library(
     'tcp_log.cc',
     'tcp_messages.cc',
     'tcp_stream_msg.cc',
-    dependencies: [crypto],
+    dependencies: [CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib',
index 80e98bbdf15ecdc3fc8775e1eb8cd6a726d656e0..0e3cc18aadd81f60d52d4a3616b9f596c1f10d99 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -8,7 +8,7 @@ kea_tcp_tests = executable(
     'run_unittests.cc',
     'tcp_listener_unittests.cc',
     cpp_args: [f'-DTEST_CA_DIR="@TEST_CA_DIR@"'],
-    dependencies: [gtest, crypto],
+    dependencies: [GTEST_DEP, CRYPTO_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib, kea_asiolink_testutils_lib] + LIBS_BUILT_SO_FAR,
 )
index 0e3e494997056a8edd79a34278f9cfd16220a3ba..e6b8d673fffa88ffb591bc033f420ec61dd09583 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not FUZZ_OPT.enabled() and not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -10,7 +10,7 @@ kea_testutils_lib = static_library(
     'threaded_test.cc',
     'unix_control_client.cc',
     'user_context_utils.cc',
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
 )
 
index 190946a806f64d5e03f8785e211d56552e6a9c93..9c2ce19a28321b66ea95788f73220844cd5e43fb 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -40,7 +40,7 @@ kea_util_tests = executable(
         f'-DABS_SRCDIR="@TOP_SOURCE_DIR@/src/lib/util/tests"',
         f'-DTEST_DATA_BUILDDIR="@TOP_BUILD_DIR@/src/lib/util/tests"',
     ],
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
index 47c2ef02e194551de84370984d4d2eb774b75b54..d14b91b192ee7b64a363f6ba25b0ac12a121a708 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found()
+if not TESTS_OPT.enabled()
     subdir_done()
 endif
 
@@ -12,6 +12,6 @@ kea_util_unittests_lib = static_library(
     'run_all.cc',
     'testdata.cc',
     'wiredata.cc',
-    dependencies: [gtest],
+    dependencies: [GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
 )
index cf0670d391574c7fd1803ac1f73e0f961ced1fc4..af1a5f27251431cab96b89dbfcf19a7b6b24c10e 100644 (file)
@@ -1,4 +1,4 @@
-if not NETCONF_DEPS_FOUND
+if not NETCONF_DEP.found()
     subdir_done()
 endif
 
@@ -23,7 +23,7 @@ kea_yang_lib = shared_library(
     'translator_pool.cc',
     'translator_shared_network.cc',
     'translator_subnet.cc',
-    dependencies: NETCONF_DEPS_ARRAY,
+    dependencies: NETCONF_DEP,
     include_directories: [include_directories('.')] + INCLUDES,
     install: true,
     install_dir: 'lib',
index 39feb100449684b7a8646f93968f20c45df1a9cd..7e53d904a61f65efbe60ae192e2f111f9712d86d 100644 (file)
@@ -1,11 +1,11 @@
-if not gtest.found() or not NETCONF_DEPS_FOUND
+if not TESTS_OPT.enabled() or not NETCONF_DEP.found()
     subdir_done()
 endif
 
 sysrepo_setup_tests = executable(
     'kea-sysrepo-setup-tests',
     'sysrepo_setup_tests.cc',
-    dependencies: NETCONF_DEPS_ARRAY + [gtest],
+    dependencies: [NETCONF_DEP, GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     override_options: ['cpp_std=c++20'],
 )
index 8e1e0eb190dc7faf9ecc02ebf1531da22a5f50a7..d6d03abe865cc98b352c2c54bd072233ce605adc 100644 (file)
@@ -1,4 +1,4 @@
-if not gtest.found() or not NETCONF_DEPS_FOUND
+if not TESTS_OPT.enabled() or not NETCONF_DEP.found()
     subdir_done()
 endif
 
@@ -31,7 +31,7 @@ kea_yang_tests = executable(
     'translator_unittests.cc',
     'translator_utils_unittests.cc',
     cpp_args: [f'-DCFG_EXAMPLES="@TOP_SOURCE_DIR@/doc/examples"'],
-    dependencies: NETCONF_DEPS_ARRAY + [gtest],
+    dependencies: [NETCONF_DEP, GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_yang_tests_libs] + LIBS_BUILT_SO_FAR,
     override_options: ['cpp_std=c++20'],
index 4db038eccc9b94329707caf87f89a8ad85a2e747..d58a0468b8b2ad48b37ee9f72fe9707bce3b3ff9 100644 (file)
@@ -1,11 +1,11 @@
-if not gtest.found() or not NETCONF_DEPS_FOUND
+if not TESTS_OPT.enabled() or not NETCONF_DEP.found()
     subdir_done()
 endif
 
 kea_yang_testutils_lib = static_library(
     'kea-yang-testutils',
     'translator_test.cc',
-    dependencies: NETCONF_DEPS_ARRAY + [gtest],
+    dependencies: [NETCONF_DEP, GTEST_DEP],
     include_directories: [include_directories('.')] + INCLUDES,
     override_options: ['cpp_std=c++20'],
 )
index 0ee2cb33b0c478328adb6c699332013cfdb1e80c..0bfec70cadab45a7f880a39fe6af401fd0b00c34 100644 (file)
@@ -1,4 +1,4 @@
-if not NETCONF_DEPS_FOUND
+if not NETCONF_DEP.found()
     subdir_done()
 endif
 
index a2cf62c245acd302dd931376af63c670bff9cbd2..9b24164edb6bedf4fb19315bfd08f7af63723814 100644 (file)
@@ -8,11 +8,11 @@ yang_utils_conf_data.set('datarootdir', f'@PREFIX@/@DATADIR@')
 yang_utils_conf_data.set('prefix', PREFIX)
 yang_utils_conf_data.set(
     'LIBYANG_PREFIX',
-    netconf_deps['yang'].get_variable('prefix'),
+    NETCONF_DEP.get_variable('libyang_prefix'),
 )
 yang_utils_conf_data.set(
     'SYSREPO_PREFIX',
-    netconf_deps['sysrepo'].get_variable('prefix'),
+    NETCONF_DEP.get_variable('sysrepo_prefix'),
 )
 
 configure_file(
diff --git a/subprojects/krb5/meson.build b/subprojects/krb5/meson.build
new file mode 100644 (file)
index 0000000..0041463
--- /dev/null
@@ -0,0 +1,16 @@
+project('krb5')
+krb5 = disabler()
+krb5_config = find_program('krb5-config', required: false)
+if krb5_config.found()
+    cflags = run_command([krb5_config, '--cflags', 'gssapi'], check: false)
+    libs = run_command([krb5_config, '--libs', 'gssapi'], check: false)
+    version = run_command([krb5_config, '--version'], check: false)
+    if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0
+        krb5_version = version.stdout().strip()
+        krb5 = declare_dependency(
+            compile_args: cflags.stdout().split(),
+            link_args: libs.stdout().split(),
+            version: krb5_version,
+        )
+    endif
+endif
diff --git a/subprojects/log4cplus/meson.build b/subprojects/log4cplus/meson.build
new file mode 100644 (file)
index 0000000..34bc1c4
--- /dev/null
@@ -0,0 +1,2 @@
+project('log4cplus')
+log4cplus = cpp.find_library('log4cplus', required: false)
diff --git a/subprojects/mysql/meson.build b/subprojects/mysql/meson.build
new file mode 100644 (file)
index 0000000..c750b9f
--- /dev/null
@@ -0,0 +1,30 @@
+project('mysql')
+mysql = disabler()
+if not MYSQL_DEP.found()
+    mysql = dependency('mysql', required: false)
+endif
+foreach mysql_config_file : ['mariadb_config', 'mysql_config']
+    if MYSQL_DEP.found()
+        continue
+    endif
+    mysql_config = find_program(mysql_config_file, required: false)
+    if not mysql_config.found()
+        continue
+    endif
+    cflags = run_command([mysql_config, '--cflags'], check: false)
+    libs = run_command([mysql_config, '--libs'], check: false)
+    version = run_command([mysql_config, '--version'], check: false)
+
+    if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0
+        mysql_compile_args = cflags.stdout().split()
+        mysql_link_args = libs.stdout().split()
+        mysql_version = version.stdout().strip()
+        mysql = declare_dependency(
+            compile_args: mysql_compile_args,
+            link_args: mysql_link_args,
+            version: mysql_version,
+        )
+        break
+    endif
+endforeach
+
diff --git a/subprojects/netconf/meson.build b/subprojects/netconf/meson.build
new file mode 100644 (file)
index 0000000..12c3e03
--- /dev/null
@@ -0,0 +1,72 @@
+project('netconf')
+cpp = meson.get_compiler('cpp')
+SYSTEM = build_machine.system()
+
+netconf_deps = {}
+
+foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp']
+    netconf_deps = netconf_deps + {dep: dependency(dep, required: false)}
+    if netconf_deps[dep].found()
+        continue
+    endif
+
+    # Try adding lib to it. libyang and libyang-cpp define the wrong pkg-config.
+    netconf_deps = netconf_deps + {
+        dep: dependency('lib' + dep, required: false),
+    }
+    if netconf_deps[dep].found()
+        continue
+    endif
+
+    # Search in /opt.
+    foreach prefix : ['', 'lib']
+        path = f'/opt/@prefix@@dep@'
+        lib = cpp.find_library(dep, dirs: [f'/@path@/lib'], required: false)
+        if lib.found()
+            netconf_deps = netconf_deps + {
+                dep: declare_dependency(
+                    dependencies: [lib],
+                    include_directories: include_directories(f'/@path@/include'),
+                    variables: {'prefix': f'@path@'},
+                ),
+            }
+            if SYSTEM == 'darwin'
+                add_project_link_arguments(
+                    f'-Wl,-rpath,@path@/lib',
+                    language: 'cpp',
+                )
+            else
+                add_project_link_arguments(
+                    f'-Wl,-rpath=@path@/lib',
+                    language: 'cpp',
+                )
+            endif
+        endif
+    endforeach
+endforeach
+
+all_deps_found = true
+foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp']
+    if not netconf_deps[dep].found()
+        all_deps_found = false
+        break
+    endif
+endforeach
+
+if all_deps_found
+    netconf = declare_dependency(
+        dependencies: [
+            netconf_deps['yang'],
+            netconf_deps['yang-cpp'],
+            netconf_deps['sysrepo'],
+            netconf_deps['sysrepo-cpp'],
+        ],
+        variables: {
+            'libyang_prefix': netconf_deps['yang'].found() ? netconf_deps['yang'].get_variable('prefix') : 'unknown',
+            'sysrepo_prefix': netconf_deps['sysrepo'].found() ? netconf_deps['sysrepo'].get_variable('prefix') : 'unknown',
+        },
+    )
+else
+    netconf = disabler()
+endif
+
diff --git a/subprojects/postgresql/meson.build b/subprojects/postgresql/meson.build
new file mode 100644 (file)
index 0000000..2d65a85
--- /dev/null
@@ -0,0 +1,18 @@
+project('postgresql')
+postgresql = disabler()
+pg_config = find_program('pg_config', required: false)
+if pg_config.found()
+    cflags = run_command([pg_config, '--cflags'], check: false)
+    libs = run_command([pg_config, '--libs'], check: false)
+    version = run_command([pg_config, '--version'], check: false)
+    if cflags.returncode() == 0 and libs.returncode() == 0 and version.returncode() == 0
+        pgsql_compile_args = cflags.stdout().split()
+        pgsql_link_args = libs.stdout().split()
+        pgsql_version = version.stdout().strip()
+        postgresql = declare_dependency(
+            compile_args: pgsql_compile_args,
+            link_args: pgsql_link_args,
+            version: pgsql_version,
+        )
+    endif
+endif