glib/subprojects/zlib.wrap

14 lines
551 B
Plaintext
Raw Normal View History

[wrap-file]
directory = zlib-1.3.1
source_url = http://zlib.net/fossils/zlib-1.3.1.tar.gz
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/zlib_1.3.1-1/zlib-1.3.1.tar.gz
source_filename = zlib-1.3.1.tar.gz
source_hash = 9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23
patch_filename = zlib_1.3.1-1_patch.zip
patch_url = https://wrapdb.mesonbuild.com/v2/zlib_1.3.1-1/get_patch
patch_hash = e79b98eb24a75392009cec6f99ca5cdca9881ff20bfa174e8b8926d5c7a47095
wrapdb_version = 1.3.1-1
Enable full-static build on Windows Glib cannot be built statically on Windows because glib, gobject and gio modules need to perform specific initialization when DLL are loaded and cleanup when unloaded. Those initializations and cleanups are performed using the DllMain function which is not called with static builds. Issue is known for a while and solutions were already proposed but never merged (see: https://gitlab.gnome.org/GNOME/glib/-/issues/692). Last patch is from version 2.36.x and since then the "constructor/destructor" mechanism has been implemented and used in other part of the system. This patch takes back the old idea and updates it to the last version of glib to allow static compilation on Windows. WARNING: because DllMain doesn't exist anymore in static compilation mode, there is no easy way of knowing when a Windows thread finishes. This patch implements a workaround for glib threads created by calling g_thread_new(), so all glib threads created through glib API will behave exactly the same way in static and dynamic compilation modes. Unfortunately, Windows threads created by using CreateThread() or _beginthread/ex() will not work with glib TLS functions. If users need absolutely to use a thread NOT created with glib API under Windows and in static compilation mode, they should not use glib functions within their thread or they may encounter memory leaks when the thread finishes. This should not be an issue as users should use exclusively the glib API to manipulate threads in order to be cross-platform compatible and this would be very unlikely and cumbersome that they may mix up Windows native threads API with glib one. Closes #692
2022-01-19 14:19:05 +01:00
[provide]
zlib = zlib_dep