Add missing visibility compiler flags

We have been building the shared library for Epoxy without the symbol
visibility flags for the compiler, which means we've been leaking
internal symbols all over the floor.

Fixes: #111
macos/v1.5.9
Emmanuele Bassi 8 years ago
parent fef61ab6be
commit 4719e586c0
  1. 10
      meson.build
  2. 4
      src/meson.build

@ -140,9 +140,11 @@ foreach cflag: test_cflags
endif endif
endforeach endforeach
# Visibility compiler flags libtype = get_option('default_library')
visibility_cflags = []
if get_option('default_library') != 'static' # Visibility compiler flags; we only use this for shared libraries
if libtype == 'shared'
visibility_cflags = []
if host_system == 'windows' if host_system == 'windows'
conf.set('DLL_EXPORT', true) conf.set('DLL_EXPORT', true)
if cc.get_id() == 'msvc' if cc.get_id() == 'msvc'
@ -152,7 +154,7 @@ if get_option('default_library') != 'static'
visibility_cflags += [ '-fvisibility=hidden' ] visibility_cflags += [ '-fvisibility=hidden' ]
endif endif
else else
conf.set('EPOXY_PUBLIC', '__attribute__((visibility("default")))') conf.set('EPOXY_PUBLIC', '__attribute__((visibility("default"))) extern')
visibility_cflags += [ '-fvisibility=hidden' ] visibility_cflags += [ '-fvisibility=hidden' ]
endif endif
endif endif

@ -68,8 +68,6 @@ if host_system == 'windows'
endif endif
# Allow building a static version of epoxy # Allow building a static version of epoxy
libtype = get_option('default_library')
if libtype != 'shared' if libtype != 'shared'
libepoxy_static = static_library('epoxy', libepoxy_static = static_library('epoxy',
sources: epoxy_sources + epoxy_headers, sources: epoxy_sources + epoxy_headers,
@ -88,7 +86,7 @@ if libtype != 'static'
install: true, install: true,
dependencies: epoxy_deps, dependencies: epoxy_deps,
include_directories: libepoxy_inc, include_directories: libepoxy_inc,
c_args: common_cflags, c_args: common_cflags + visibility_cflags,
link_args: common_ldflags) link_args: common_ldflags)
libepoxy = libepoxy_shared libepoxy = libepoxy_shared
endif endif

Loading…
Cancel
Save