Non-GObject-based libraries are not (reliably) introspectable, and this only
happens to work by accident, at the moment.
Briefly: In non-libtool mode, g-ir-scanner inspects the run-time
dependencies of a generated executable to determine the shared library name
an -l flag corresponds to. But this generated executable only references
the libraries by *_get_type() functions. So, if the library doesn't contain
any Gobject-based types, it is not referenced, and this inspection fails
with PECOFF binaries. It seems that distutils doesn't currently decide to
use --as-needed, so this just happens to work on ELF.
g-ir-scanner --no-libtool needed some fixes similar to [1] for Cygwin, as
well. Now that is done, it's possible to make these tests run and pass on
Cygwin.
[1] https://bugzilla.gnome.org/show_bug.cgi?id=781525
We were doing this on the basis of an old comment, but there was no
test for it and I couldn't reproduce the issue with clang on Linux
at all.
Let's add a (somewhat comprehensive) test and see if it breaks
anywhere if we stop doing this.
Halves the size of gstreamer's build.ninja from 20M to 8.7M
Closes https://github.com/mesonbuild/meson/issues/1057