Skip to content

Commit

Permalink
Merge pull request #3490 from eli-schwartz/meson-tests-noprograms
Browse files Browse the repository at this point in the history
meson: always build the zstd binary when tests are enabled
  • Loading branch information
Cyan4973 authored Feb 16, 2023
2 parents 8420502 + 97ab0e2 commit 4ebaf36
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/meson/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ endif

subdir('lib')

if bin_programs
if bin_programs or bin_tests
subdir('programs')
endif

Expand Down
9 changes: 8 additions & 1 deletion build/meson/programs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,14 @@ zstd = executable('zstd',
c_args: zstd_c_args,
dependencies: zstd_deps,
export_dynamic: export_dynamic_on_windows, # Since Meson 0.45.0
install: true)
build_by_default: bin_programs,
install: bin_programs)

if not bin_programs
# we generate rules to build the programs, but don't install anything
# so do not continue to installing scripts and manpages
subdir_done()
endif

zstd_frugal_sources = [join_paths(zstd_rootdir, 'programs/zstdcli.c'),
join_paths(zstd_rootdir, 'programs/timefn.c'),
Expand Down
2 changes: 1 addition & 1 deletion build/meson/tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ if host_machine_os != os_windows
playTests_sh,
args: opt,
env: ['ZSTD_BIN=' + zstd.full_path(), 'DATAGEN_BIN=./datagen'],
depends: [datagen],
depends: [datagen, zstd],
suite: suite,
workdir: meson.current_build_dir(),
timeout: 2800) # Timeout should work on HDD drive
Expand Down

0 comments on commit 4ebaf36

Please sign in to comment.