Skip to content

Commit 4ebaf36

Browse files
authored
Merge pull request #3490 from eli-schwartz/meson-tests-noprograms
meson: always build the zstd binary when tests are enabled
2 parents 8420502 + 97ab0e2 commit 4ebaf36

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

build/meson/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ endif
132132

133133
subdir('lib')
134134

135-
if bin_programs
135+
if bin_programs or bin_tests
136136
subdir('programs')
137137
endif
138138

build/meson/programs/meson.build

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,14 @@ zstd = executable('zstd',
7272
c_args: zstd_c_args,
7373
dependencies: zstd_deps,
7474
export_dynamic: export_dynamic_on_windows, # Since Meson 0.45.0
75-
install: true)
75+
build_by_default: bin_programs,
76+
install: bin_programs)
77+
78+
if not bin_programs
79+
# we generate rules to build the programs, but don't install anything
80+
# so do not continue to installing scripts and manpages
81+
subdir_done()
82+
endif
7683

7784
zstd_frugal_sources = [join_paths(zstd_rootdir, 'programs/zstdcli.c'),
7885
join_paths(zstd_rootdir, 'programs/timefn.c'),

build/meson/tests/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ if host_machine_os != os_windows
162162
playTests_sh,
163163
args: opt,
164164
env: ['ZSTD_BIN=' + zstd.full_path(), 'DATAGEN_BIN=./datagen'],
165-
depends: [datagen],
165+
depends: [datagen, zstd],
166166
suite: suite,
167167
workdir: meson.current_build_dir(),
168168
timeout: 2800) # Timeout should work on HDD drive

0 commit comments

Comments
 (0)