From ae7dee33f580062dee6e1d7a392f3e3828e732e6 Mon Sep 17 00:00:00 2001 From: Olivier Certner Date: Mon, 13 Jan 2025 11:40:48 +0100 Subject: [PATCH 1/2] meson.build: Fix detection of libzim built with Xapian The dependency on libzim must be specified in compiler.has_header_symbol() for it to find the header in all cases (i.e., also when not installed in locations the compiler considers standard). This is essentially the same fix as was done earlier in libzim. --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 91556676..d9b64a4e 100644 --- a/meson.build +++ b/meson.build @@ -19,7 +19,8 @@ endif libzim_dep = dependency('libzim', version:['>=9.2.0', '<10.0.0'], static:static_linkage) -with_xapian_support = compiler.has_header_symbol('zim/zim.h', 'LIBZIM_WITH_XAPIAN') +with_xapian_support = compiler.has_header_symbol( + 'zim/zim.h', 'LIBZIM_WITH_XAPIAN', dependencies: libzim_dep) find_library_in_compiler = meson.version().version_compare('>=0.31.0') rt_dep = dependency('rt', required:false) From 91e932c73ccb8896d8635d018902c1080316f4ab Mon Sep 17 00:00:00 2001 From: Olivier Certner Date: Mon, 13 Jan 2025 11:45:53 +0100 Subject: [PATCH 2/2] zimcheck/meson.build: Fix FreeBSD build; Avoid crushing 'thread_dep' On FreeBSD, LLVM's libc++ also relies on pthread. zimcheck's 'meson.build' would use the same 'thread_dep' variable set in the root 'meson.build' file on building zimwriterfs, crushing the value set there in some cases, which would then be used in zimwriterfs' 'meson.build'. Note: Some of the introduced line is very long but has not been wrapped as Meson 0.49.2 is still used in the MacOS CI and it does not not support continuing lines with '\'. --- src/zimcheck/meson.build | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/zimcheck/meson.build b/src/zimcheck/meson.build index 6871df71..7432b1c8 100644 --- a/src/zimcheck/meson.build +++ b/src/zimcheck/meson.build @@ -8,11 +8,12 @@ endif inc = include_directories(extra_include) -if compiler.get_id() == 'gcc' and host_machine.system() == 'linux' - # C++ std::thread is implemented using pthread on linux by gcc - thread_dep = dependency('threads') -else - thread_dep = dependency('', required:false) +zimcheck_deps = [libzim_dep, icu_dep, docopt_dep] + +# C++ std::thread is implemented using pthread on Linux by GCC, and on FreeBSD +# for both GCC and LLVM. +if (host_machine.system() == 'linux' and compiler.get_id() == 'gcc') or host_machine.system() == 'freebsd' + zimcheck_deps += dependency('threads') endif executable('zimcheck', @@ -23,7 +24,5 @@ executable('zimcheck', '../tools.cpp', '../metadata.cpp', include_directories : inc, - dependencies: [libzim_dep, icu_dep, thread_dep, docopt_dep], + dependencies: zimcheck_deps, install: true) - -