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'.

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 '\'.
  • Loading branch information
OlCe2 committed Feb 6, 2025
1 parent bc20d4f commit ed3eb7e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/zimcheck/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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)


0 comments on commit ed3eb7e

Please sign in to comment.