From ccc02a9a7786c7556d31cfd3d7b08ba8d6895eea Mon Sep 17 00:00:00 2001 From: Artem Labazov Date: Mon, 30 Sep 2024 18:05:57 +0300 Subject: [PATCH] meson: Fix contrib and tests build --- build/meson/contrib/pzstd/meson.build | 2 +- build/meson/lib/meson.build | 9 ++++++--- build/meson/tests/meson.build | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build/meson/contrib/pzstd/meson.build b/build/meson/contrib/pzstd/meson.build index b95dc7964..c3ee3d60a 100644 --- a/build/meson/contrib/pzstd/meson.build +++ b/build/meson/contrib/pzstd/meson.build @@ -20,6 +20,6 @@ pzstd = executable('pzstd', pzstd_sources, cpp_args: pzstd_warning_flags, include_directories: pzstd_includes, - dependencies: [ libzstd_dep, thread_dep ], + dependencies: [ libzstd_internal_dep, thread_dep ], override_options: ['b_ndebug=true'], install: true) diff --git a/build/meson/lib/meson.build b/build/meson/lib/meson.build index 6c5d53d1a..4ff926f9c 100644 --- a/build/meson/lib/meson.build +++ b/build/meson/lib/meson.build @@ -134,7 +134,8 @@ libzstd_dep = declare_dependency(link_with: libzstd, # -fvisibility=hidden means those cannot be found if get_option('default_library') == 'static' libzstd_static = libzstd - libzstd_internal_dep = libzstd_dep + libzstd_internal_dep = declare_dependency(link_with: libzstd, + include_directories: libzstd_includes) else if get_option('default_library') == 'shared' libzstd_static = static_library('zstd_objlib', @@ -147,11 +148,13 @@ else if cc_id == compiler_msvc # msvc does not actually support linking to both, but errors out with: # error LNK2005: ZSTD_ already defined in zstd.lib(zstd-1.dll) - libzstd_internal_dep = declare_dependency(link_with: libzstd_static) + libzstd_internal_dep = declare_dependency(link_with: libzstd_static, + include_directories: libzstd_includes) else libzstd_internal_dep = declare_dependency(link_with: libzstd, # the static library must be linked after the shared one - dependencies: declare_dependency(link_with: libzstd_static)) + dependencies: declare_dependency(link_with: libzstd_static), + include_directories: libzstd_includes) endif endif diff --git a/build/meson/tests/meson.build b/build/meson/tests/meson.build index 9847ab037..71ffc5069 100644 --- a/build/meson/tests/meson.build +++ b/build/meson/tests/meson.build @@ -93,7 +93,7 @@ roundTripCrash = executable('roundTripCrash', longmatch_sources = [join_paths(zstd_rootdir, 'tests/longmatch.c')] longmatch = executable('longmatch', longmatch_sources, - dependencies: [ libzstd_dep ], + dependencies: [ libzstd_internal_dep ], install: false) invalidDictionaries_sources = [join_paths(zstd_rootdir, 'tests/invalidDictionaries.c')]