]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
meson: make -Dmalloc=auto more clever docs-develop-meso-grzeae/deployments/4794
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 5 Aug 2024 11:23:13 +0000 (13:23 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 5 Aug 2024 11:23:13 +0000 (13:23 +0200)
meson.build
tests/meson.build

index 0e91427a885b69f473f59052f9302176f1237fd0..251991dda703b0f2039deffbadd987f44d7755c4 100644 (file)
@@ -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',
index 818169dfcb24d5d9cdaf17fbf7479f8faeeb086f..3b2bb6548976955b485ffef016202de255755aea 100644 (file)
@@ -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