Skip to content

Commit

Permalink
meson: generalise build_apple to has_dlvsym
Browse files Browse the repository at this point in the history
build_apple was introduced in 756dca as a proxy for the fact that Apple's libc
doesn't have dlvsym(), which is glibc-specific so also isn't present in other
libc implementations such as musl.

Instead of detecting whether we are building for Apple or not, just probe the to
see if we have dlvsym.
  • Loading branch information
rossburton committed Mar 12, 2018
1 parent a35192b commit 1267f82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 0 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,12 @@ endif
# The remaining platform specific API for GL/GLES are enabled
# depending on the platform we're building for
if host_system == 'windows'
build_apple = false
build_wgl = true
has_znow = true
elif host_system == 'darwin'
build_apple = true
build_wgl = false
has_znow = false
else
build_apple = false
build_wgl = false
has_znow = true
endif
Expand Down
9 changes: 6 additions & 3 deletions test/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
dl_dep = cc.find_library('dl', required: false)
has_dlvsym = cc.has_function('dlvsym', dependencies: dl_dep)

has_gles1 = gles1_dep.found()
has_gles2 = gles2_dep.found()
build_x11_tests = enable_x11 and x11_dep.found()
Expand Down Expand Up @@ -92,8 +95,8 @@ if build_glx
[ 'glx_has_extension_nocontext', [ 'glx_has_extension_nocontext.c' ], [], [], true ],
[ 'glx_static', [ 'glx_static.c' ], [ '-DNEEDS_TO_BE_STATIC'], [ '-static' ], libtype == 'static' ],
[ 'glx_shared_znow', [ 'glx_static.c', ], [], [ '-Wl,-z,now' ], has_znow ],
[ 'glx_alias_prefer_same_name', [ 'glx_alias_prefer_same_name.c', 'dlwrap.c', 'dlwrap.h' ], [], [ '-rdynamic' ], not build_apple ],
[ 'glx_gles2', [ 'glx_gles2.c', 'dlwrap.c', 'dlwrap.h' ], [], [ '-rdynamic' ], not build_apple ],
[ 'glx_alias_prefer_same_name', [ 'glx_alias_prefer_same_name.c', 'dlwrap.c', 'dlwrap.h' ], [], [ '-rdynamic' ], has_dlvsym ],
[ 'glx_gles2', [ 'glx_gles2.c', 'dlwrap.c', 'dlwrap.h' ], [], [ '-rdynamic' ], has_dlvsym ],
]

foreach test: glx_tests
Expand All @@ -114,7 +117,7 @@ if build_glx
endif
endforeach

if not build_apple
if has_dlvsym
# GLX/EGL tests
if build_egl
glx_egl_sources = [
Expand Down

0 comments on commit 1267f82

Please # to comment.