These changes enable producing a static build of glib on Windows with MSVC.
See GNOME/glib!1655 for prior art.
(This MR is intentionally opened against fasterthanlime/glib
rather than GNOME/glib
, because it is not meant to be merged, I just want a convenient view of what my current changeset is.)
General approach
-
Use CreateProcess directly instead of CRT _wspanw* functions where applicable. -
Switch to using FLS in the GPrivate implementation on Windows. -
Move the code that now resides in DllMain and handles DLL_PROCESS_ATTACH into a PE constructor. -
Modify the build definitions to allow static builds on Windows.
Dependencies
This MR needs these to land first:
CI pipelines
This adds two CI pipelines. Both msys2-mingw32
and vs2017-x64
got -static
and -shared
variants.
Tests
Not all tests are expected to run on MSVC builds anyway (even dynamic ones), here's a list of expected failures (taken from a recent main
run):
https://gist.github.com/fasterthanlime/89b740e9eef045c8d33759c0693174b5