diff options
author | Sam Thursfield <sam@afuera.me.uk> | 2017-07-21 12:33:49 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2017-08-09 17:12:02 +0200 |
commit | 213a8c015b0d233dc32ca3b2699da71c706958a7 (patch) | |
tree | 79fee0065119184dbc1edd3d9c55fb13c1b94f5b /meson.build | |
parent | 9c2091d67d581fed07dae8dc4b0e0541bc6be3f8 (diff) | |
download | libmediaart-213a8c015b0d233dc32ca3b2699da71c706958a7.tar.gz |
Use compiler symbol visiblity features to hide internal functions
Previously we relied on libtool's -export-symbols-regex feature, but we
are hoping to drop GNU Autotools and GNU Libtool in soon in favour of
Meson.
Meson doesn't have an equivalent feature, instead the advice is to
control symbol visibility at compile time.
The approach taken in this patch is based on Pango's build system. Pango
tells the compiler to hide symbols by default (if possible), and then defines
a _PANGO_EXTERN variable at compile time which marks a single symbol as
public. In Pango's case there is then further machinary to hide symbols
based on deprecation policies but I have not copied that here, instead I
used _LIBMEDIAART_EXTERN directly.
If a compiler doesn't support hiding symbols then the library we build
makes all symbols available, which is exactly what would happen before
on platforms where the libtool didn't have an implementation for
-export-symbols-regex.
See also:
http://mesonbuild.com/FAQ.html#how-do-i-do-the-equivalent-of-libtools-exportsymbol-and-exportregex
https://git.gnome.org/browse/pango/
https://git.gnome.org/browse/pango/tree/pango/pango-version-macros.h
https://gcc.gnu.org/wiki/Visibility
https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options (-fvisibility)
https://bugzilla.gnome.org/show_bug.cgi?id=783562
Diffstat (limited to 'meson.build')
0 files changed, 0 insertions, 0 deletions