forked from AuroraMiddleware/gtk
build: Add missing symbol visibility flags
GTK symbols are not visible by default, and only the ones annotated with _GDK_EXTERN (and wrapper macros) are exported. We need to define _GDK_EXTERN during the configuration, depending on the platform and compiler we use.
This commit is contained in:
parent
68039b610b
commit
c97ef81a10
16
meson.build
16
meson.build
@ -255,6 +255,22 @@ foreach cflag: test_cflags
|
||||
endif
|
||||
endforeach
|
||||
|
||||
# Symbol visibility
|
||||
if get_option('default_library') != 'static'
|
||||
if host_machine.system() == 'windows'
|
||||
cdata.set('DLL_EXPORT', true)
|
||||
if cc.get_id() == 'msvc'
|
||||
cdata.set('_GDK_EXTERN', '__declspec(dllexport) extern')
|
||||
else
|
||||
cdata.set('_GDK_EXTERN', '__attribute__((visibility("default"))) __declspec(dllexport) extern')
|
||||
common_cflags += ['-fvisibility=hidden']
|
||||
endif
|
||||
else
|
||||
cdata.set('_GDK_EXTERN', '__attribute__((visibility("default"))) extern')
|
||||
common_cflags += ['-fvisibility=hidden']
|
||||
endif
|
||||
endif
|
||||
|
||||
confinc = include_directories('.')
|
||||
gdkinc = include_directories('gdk')
|
||||
gtkinc = include_directories('gtk')
|
||||
|
Loading…
Reference in New Issue
Block a user