Skip to content

Commit

Permalink
Merge branch 'meson-jemalloc-auto' into 'master'
Browse files Browse the repository at this point in the history
meson: make -Dmalloc=auto more clever

See merge request knot/knot-resolver!1583
  • Loading branch information
Spiffyk committed Aug 5, 2024
2 parents 32ce5cf + 5725961 commit a9c7dd2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 0 additions & 1 deletion tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a9c7dd2

Please sign in to comment.