]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
meson: always build the zstd binary when tests are enabled 3490/head
authorEli Schwartz <eschwartz@archlinux.org>
Fri, 10 Feb 2023 04:55:09 +0000 (23:55 -0500)
committerEli Schwartz <eschwartz@archlinux.org>
Fri, 10 Feb 2023 05:33:07 +0000 (00:33 -0500)
We need to run it for the tests, even if programs are disabled. So if
they are disabled, create a build rule for the program, but don't
install it. Just make it available for the test itself.

build/meson/meson.build
build/meson/programs/meson.build

index 576dc44db37b28e25a1d597127bb6b37ed79131d..15c56c2b13aa90b65578b47ee198f5a207261e8a 100644 (file)
@@ -132,7 +132,7 @@ endif
 
 subdir('lib')
 
-if bin_programs
+if bin_programs or bin_tests
   subdir('programs')
 endif
 
index e611dc3374cbbac726f88c9c4c6bf55ac6e2f2e8..0b5a9305604e5bab0e87f54f2de31288bb6e0469 100644 (file)
@@ -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'),