mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-14 13:26:16 +01:00
dcfc9f689e
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.
39 lines
1.1 KiB
Meson
39 lines
1.1 KiB
Meson
# Just a skeleton lib for backwards compatibility since all the functionaliy
|
|
# has been moved into glib now
|
|
|
|
gthread_sources = ['gthread-impl.c']
|
|
if host_system == 'windows'
|
|
gthread_win_rc = configure_file(
|
|
input: 'gthread.rc.in',
|
|
output: 'gthread.rc',
|
|
configuration: glibconfig_conf,
|
|
)
|
|
gthread_win_res = windows.compile_resources(gthread_win_rc)
|
|
gthread_sources += [gthread_win_res]
|
|
endif
|
|
|
|
libgthread = library('gthread-2.0',
|
|
sources : gthread_sources,
|
|
version : library_version,
|
|
soversion : soversion,
|
|
darwin_versions : darwin_versions,
|
|
install : true,
|
|
dependencies : [libglib_dep],
|
|
c_args : ['-DG_LOG_DOMAIN="GThread"', glib_c_args_internal],
|
|
gnu_symbol_visibility : 'hidden',
|
|
link_args : glib_link_flags,
|
|
)
|
|
|
|
pkg.generate(libgthread,
|
|
libraries : [thread_dep],
|
|
requires : ['glib-2.0'],
|
|
version : glib_version,
|
|
install_dir : glib_pkgconfigreldir,
|
|
filebase : 'gthread-2.0',
|
|
name : 'GThread',
|
|
description : 'Thread support for GLib',
|
|
)
|
|
|
|
libgthread_dep = declare_dependency(link_with : libgthread)
|
|
meson.override_dependency('gthread-2.0', libgthread_dep)
|