glib/tools/meson.build
Xavier Claessens dcfc9f689e Fix symbol visibility macros on Windows
There is currently no `dllimport` attribute on any of our function,
which prevents MSVC to optimize function calls.

To fix that issue, we need to redeclare all our visibility macros for
each of our libraries, because when compiling e.g. GIO code, we need
dllimport in GLIB headers and dllexport in GIO headers. That means they
cannot use the same GLIB_AVAILABLE_* macro.

Since that's a lot of boilerplate to copy/paste after each version bump,
this MR generate all those macros using a python script.

Also simplify the meson side by using `gnu_symbol_visibility : 'hidden'`
keyword argument instead of passing the cflag manually.

This leaves only API index to add manually into glib-docs.xml when
bumping GLib version. That file cannot be generated because Meson does
not allow passing a buit file to gnome.gtkdoc()'s main_xml kwarg
unfortunately.
2022-10-13 20:53:56 -04:00

27 lines
943 B
Meson

# Install glib-gettextize executable, if a UNIX-style shell is found
if have_sh
# These should not contain " quotes around the values
gettextize_conf = configuration_data()
gettextize_conf.set('PACKAGE', 'glib')
gettextize_conf.set('VERSION', meson.project_version())
gettextize_conf.set('prefix', glib_prefix)
gettextize_conf.set('datarootdir', glib_datadir)
gettextize_conf.set('datadir', glib_datadir)
configure_file(input : 'glib-gettextize.in',
install_dir : glib_bindir,
install_tag : 'bin-devel',
output : 'glib-gettextize',
configuration : gettextize_conf)
endif
if host_system != 'windows'
# Install Valgrind suppression file (except on Windows,
# as Valgrind is currently not supported on Windows)
install_data('glib.supp',
install_dir : get_option('datadir') / 'glib-2.0' / 'valgrind',
install_tag : 'devel',
)
endif
gen_visibility_macros = find_program('gen-visibility-macros.py')