From 2b5ff310c4a698815da430c47ca7bd855f04253a Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 26 Aug 2024 15:10:31 +0200 Subject: [PATCH] Correctly compile tests if build without writer (on Windows) --- test/meson.build | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/meson.build b/test/meson.build index dcb5e580..704aba53 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,12 +1,20 @@ gtest_dep = dependency('gtest', main:true, fallback:['gtest', 'gtest_main_dep'], required:false) + +test_deps = [gtest_dep, libzim_dep, icu_dep] tests = [ 'metadata-test', - 'tools-test', - 'zimwriterfs-zimcreatorfs', 'zimcheck-test' ] +if with_writer + tests += [ + 'tools-test', + 'zimwriterfs-zimcreatorfs' + ] + test_deps += [gumbo_dep, magic_dep, zlib_dep] +endif + zimwriter_srcs = [ '../src/zimwriterfs/tools.cpp', '../src/zimwriterfs/zimcreatorfs.cpp', '../src/tools.cpp'] @@ -21,7 +29,7 @@ if gtest_dep.found() and not meson.is_cross_build() foreach test_name : tests test_exe = executable(test_name, [test_name+'.cpp'] + tests_src_map[test_name], - dependencies : [gtest_dep, libzim_dep, gumbo_dep, magic_dep, zlib_dep, icu_dep], + dependencies : test_deps, include_directories: inc, build_rpath : '$ORIGIN')