Skip to content

Commit

Permalink
Add missing visibility compiler flags
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ebassi committed Mar 9, 2017
1 parent fef61ab commit 4719e58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 6 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ foreach cflag: test_cflags
endif
endforeach

# Visibility compiler flags
visibility_cflags = []
if get_option('default_library') != 'static'
libtype = get_option('default_library')

# Visibility compiler flags; we only use this for shared libraries
if libtype == 'shared'
visibility_cflags = []
if host_system == 'windows'
conf.set('DLL_EXPORT', true)
if cc.get_id() == 'msvc'
Expand All @@ -152,7 +154,7 @@ if get_option('default_library') != 'static'
visibility_cflags += [ '-fvisibility=hidden' ]
endif
else
conf.set('EPOXY_PUBLIC', '__attribute__((visibility("default")))')
conf.set('EPOXY_PUBLIC', '__attribute__((visibility("default"))) extern')
visibility_cflags += [ '-fvisibility=hidden' ]
endif
endif
Expand Down
4 changes: 1 addition & 3 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ if host_system == 'windows'
endif

# Allow building a static version of epoxy
libtype = get_option('default_library')

if libtype != 'shared'
libepoxy_static = static_library('epoxy',
sources: epoxy_sources + epoxy_headers,
Expand All @@ -88,7 +86,7 @@ if libtype != 'static'
install: true,
dependencies: epoxy_deps,
include_directories: libepoxy_inc,
c_args: common_cflags,
c_args: common_cflags + visibility_cflags,
link_args: common_ldflags)
libepoxy = libepoxy_shared
endif
Expand Down

0 comments on commit 4719e58

Please sign in to comment.