GNOME Bugzilla – Bug 794636
G_HAVE_GNUC_VISIBILITY is defined in meson MinGW builds
Last modified: 2018-03-28 11:56:52 UTC
This causes G_GNUC_INTERNAL to be incorrectly defined, and later each function with G_GNUC_INTERNAL produces a compile-time warning.
Created attachment 370063 [details] [review] Use a real test for G_HAVE_GNUC_VISIBILITY Accurate G_HAVE_GNUC_VISIBILITY is needed to correctly define G_GNUC_INTERNAL later on. Autotools did that, meson currently doesn't and opts to just set G_HAVE_GNUC_VISIBILITY to 1 for all compilers except MSVC. This leads to MinGW GCC having G_HAVE_GNUC_VISIBILITY=1, which results in G_GNUC_INTERNAL being defined to __attribute__((visibility("hidden"))), which is not supported. Because cc.compiles() does not support override_options or anything like that, we just feed it '-Werror' as-is, since MSVC is known as not supporting visibility attributes anyway.
Review of attachment 370063 [details] [review]: Okay
Attachment 370063 [details] pushed as a9c6531 - Use a real test for G_HAVE_GNUC_VISIBILITY