From 5c4bb1f93be369daa87466750b74e928a0ebdfa7 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 3 Aug 2023 22:49:08 -0400 Subject: [PATCH] build: Set the default visibility 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index b99bf847b3..1c03a6cc48 100644 --- a/meson.build +++ b/meson.build @@ -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', -- 2.30.2