Skip to content

Commit

Permalink
Merge pull request #916 from openzim/fix_meson_pkgconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
mgautierfr authored Aug 21, 2024
2 parents c4f909a + 448c52c commit 532bbb8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
3 changes: 1 addition & 2 deletions examples/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

executable('createZimExample', 'createZimExample.cpp',
link_with: libzim,
link_args: extra_link_args,
include_directories: include_directory,
dependencies: [thread_dep, xapian_dep, icu_dep, lzma_dep, zstd_dep])
dependencies: [thread_dep, xapian_dep, icu_dep, lzma_dep, zstd_dep, win_deps])
15 changes: 6 additions & 9 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ endif
private_conf.set('ENABLE_XAPIAN', xapian_dep.found())
public_conf.set('LIBZIM_WITH_XAPIAN', xapian_dep.found())

pkg_requires = ['liblzma', 'libzstd']
if build_machine.system() == 'windows'
extra_link_args = ['-lRpcrt4', '-lWs2_32', '-lwinmm', '-licuuc', '-licuin']
extra_cpp_args = ['-DSORTPP_PASS']
win_deps = declare_dependency(
compile_args: ['-DSORTPP_PASS'],
link_args: ['-lRpcrt4', '-lWs2_32', '-lwinmm', '-lshlwapi']
)
else
extra_link_args = []
extra_cpp_args = []
win_deps = declare_dependency()
endif

compiler = meson.get_compiler('cpp')
Expand All @@ -77,9 +77,7 @@ else
endif

if xapian_dep.found()
pkg_requires += ['xapian-core']
icu_dep = dependency('icu-i18n', static:static_linkage)
pkg_requires += ['icu-i18n']
else
icu_dep = dependency('icu-i18n', required:false, static:static_linkage)
endif
Expand Down Expand Up @@ -107,5 +105,4 @@ pkg_mod.generate(libraries : libzim,
version : meson.project_version(),
name : 'libzim',
filebase : 'libzim',
description : 'A Library to read/write ZIM files.',
requires : pkg_requires)
description : 'A Library to read/write ZIM files.')
4 changes: 1 addition & 3 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ xapian_sources = [
]

sources = common_sources
deps = [thread_dep, lzma_dep, zstd_dep]
deps = [thread_dep, lzma_dep, zstd_dep, win_deps]

if target_machine.system() == 'freebsd'
deps += [execinfo_dep]
Expand All @@ -73,8 +73,6 @@ libzim = library('zim',
sources,
include_directories : inc,
dependencies : deps,
link_args : extra_link_args,
cpp_args : extra_cpp_args,
version: meson.project_version(),
install : true)
libzim_dep = declare_dependency(link_with: libzim,
Expand Down
1 change: 0 additions & 1 deletion test/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ if gtest_dep.found() and not meson.is_cross_build()
implicit_include_directories: false,
include_directories: [include_directory, src_directory],
link_with: libzim,
link_args: extra_link_args,
cpp_args: test_cpp_args,
dependencies: deps + [gtest_dep],
build_rpath: '$ORIGIN')
Expand Down

0 comments on commit 532bbb8

Please sign in to comment.