Skip to content

Commit

Permalink
zimcheck/meson.build: Fix FreeBSD build; Avoid crushing 'thread_dep'
Browse files Browse the repository at this point in the history
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'.
  • Loading branch information
OlCe2 committed Jan 13, 2025
1 parent bc20d4f commit 39bfaa0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/zimcheck/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ 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',
Expand All @@ -23,7 +25,5 @@ executable('zimcheck',
'../tools.cpp',
'../metadata.cpp',
include_directories : inc,
dependencies: [libzim_dep, icu_dep, thread_dep, docopt_dep],
dependencies: zimcheck_deps,
install: true)


0 comments on commit 39bfaa0

Please sign in to comment.