meson: fix incorrect use of global arguments to set symbol visibility
authorEli Schwartz <eschwartz93@gmail.com>
Wed, 5 Jan 2022 04:42:03 +0000 (23:42 -0500)
committerEli Schwartz <eschwartz93@gmail.com>
Wed, 5 Jan 2022 04:42:03 +0000 (23:42 -0500)
add_global_arguments applies to all subprojects, or more usually, fails.
The meson docs suggest that add_project_arguments is probably preferable
for this reason.

However, in this case it should only be applied to a single library as a
workaround for supporting older versions of meson. Move it to a
per-target c_args instead, for the same effect.

src/lib/meson.build

index e070c370460cc5684bf80eb49a81e2635634613d..cae5058695c1a5bb1177f8bfb053f7d6a1f8911c 100644 (file)
@@ -1,5 +1,4 @@
 lib_sources = files()
-add_global_arguments('-fvisibility=hidden', language : 'c')
 subdir('buzhash')
 subdir('comp')
 subdir('hash')
@@ -8,6 +7,8 @@ subdir('dl')
 lib_sources += files('zck.c', 'header.c', 'io.c', 'log.c', 'compint.c', 'error.c')
 zcklib = library('zck',
                         lib_sources,
+                        # in meson 0.48, use `gnu_symbol_visibility: 'hidden'` kwarg
+                        c_args: ['-fvisibility=hidden'],
                         include_directories: inc,
                         dependencies: [zstd_dep, openssl_dep],
                         install: true,