build: Set the default visibility
authorMatthias Clasen <mclasen@redhat.com>
Fri, 4 Aug 2023 02:49:08 +0000 (22:49 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 4 Aug 2023 10:15:13 +0000 (06:15 -0400)
While working on deprecation cleanups, I noticed
that removing GDK_DEPRECATED_IN... from headers
does not have the effect of making the symbols
disappear, since we were forgetting to set the
default visibility to hidden.

meson.build

index b99bf847b3ed3a49ec65f6bd0b40c99f2c378377..1c03a6cc482159f69520bb733761b63e7aaead57 100644 (file)
@@ -339,15 +339,17 @@ else
   test_cflags = []
 endif
 
-common_cflags = cc.get_supported_arguments(test_cflags)
-
 # Symbol visibility
 if get_option('default_library') != 'static'
   if os_win32
     cdata.set('DLL_EXPORT', true)
+  else
+    test_cflags += ['-fvisibility=hidden']
   endif
 endif
 
+common_cflags = cc.get_supported_arguments(test_cflags)
+
 common_ldflags = cc.get_supported_link_arguments([
   '-Wl,-Bsymbolic',
   '-Wl,-z,relro',