Commit 5cd6c8f2 authored by Dylan Baker's avatar Dylan Baker

meson: Fix build on macos

There is a bug in meson's Compiler.has_function_attribute('visibility'),
which results in it incorrectly returning False on macos. This causes
meson to not defined BZ_EXTERN, but the gnu_symbol_visibility results in
hidden by default symbols. This means that there are no visible symbols
in libbz2 at all and linking naturally fails.

Fixes #18
parent a51fb732
......@@ -20,7 +20,8 @@ if host_machine.system() == 'windows'
endif
c_args = []
if cc.has_function_attribute('visibility')
# The or is a workaround for https://github.com/mesonbuild/meson/issues/5530
if cc.has_function_attribute('visibility') or (cc.get_id() == 'clang' and host_machine.system() == 'darwin')
c_args += '-DBZ_EXTERN=__attribute__((__visibility__("default")))'
endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment