From: Vladimír Čunát Date: Mon, 5 Aug 2024 11:23:13 +0000 (+0200) Subject: meson: make -Dmalloc=auto more clever X-Git-Tag: v6.0.9~39^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fenvironments%2Fdocs-develop-meso-grzeae%2Fdeployments%2F4794;p=thirdparty%2Fknot-resolver.git meson: make -Dmalloc=auto more clever --- diff --git a/meson.build b/meson.build index 0e91427a8..251991dda 100644 --- a/meson.build +++ b/meson.build @@ -137,9 +137,15 @@ systemd_files = get_option('systemd_files') systemd_legacy_units = get_option('systemd_legacy_units') libsystemd = dependency('libsystemd', required: systemd_files == 'enabled') +# Uh, lifted this trivial line from tests/meson.build due to dependency sorting: +build_extra_tests = get_option('extra_tests') == 'enabled' + ### Allocator # use empty name to disable the dependency, but still compile the dependent kresd -malloc_name = get_option('malloc') == 'disabled' ? '' : 'jemalloc' +malloc_name = '' +if get_option('malloc') == 'jemalloc' or (get_option('malloc') == 'auto' and not build_extra_tests) + malloc_name = 'jemalloc' +endif malloc = meson.get_compiler('c').find_library( malloc_name, required: get_option('malloc') == 'jemalloc', diff --git a/tests/meson.build b/tests/meson.build index 818169dfc..3b2bb6548 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -13,7 +13,6 @@ if get_option('unit_tests') != 'disabled' message('-------------------------------') endif -build_extra_tests = get_option('extra_tests') == 'enabled' build_config_tests = get_option('config_tests') == 'enabled' if get_option('config_tests') == 'auto' build_config_tests = build_extra_tests