meson: Ensure we always build Xext/hashtable.c for glx

Seems that while glxvnd relies on some of the hashtable functions in
Xext, we only build hashtable support for Xext if we're also building
the res extension. This leads to some errors if you try to build glx
without res enabled:

glx/liblibglxvnd.a(vndcmds.c.o): In function `LookupVendorPrivDispatch':
/home/lyudess/Projects/xserver/glx/vndcmds.c:65: undefined reference to `ht_find'
/home/lyudess/Projects/xserver/glx/vndcmds.c:67: undefined reference to `ht_add'
glx/liblibglxvnd.a(vndcmds.c.o): In function `GlxDispatchInit':
/home/lyudess/Projects/xserver/glx/vndcmds.c:405: undefined reference to `ht_generic_compare'
/home/lyudess/Projects/xserver/glx/vndcmds.c:405: undefined reference to `ht_generic_hash'
/home/lyudess/Projects/xserver/glx/vndcmds.c:405: undefined reference to `ht_create'
glx/liblibglxvnd.a(vndcmds.c.o): In function `GlxDispatchReset':
/home/lyudess/Projects/xserver/glx/vndcmds.c:468: undefined reference to `ht_destroy'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

So, make sure that hashtable.c gets both for both glx and res

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
This commit is contained in:
Lyude Paul 2018-04-18 18:09:15 -04:00 committed by Adam Jackson
parent 3b4671f9e9
commit 4e28a6a223
2 changed files with 14 additions and 1 deletions

View File

@ -23,8 +23,12 @@ if build_mitshm
hdrs_xext += ['shmint.h']
endif
if build_hashtable
srcs_xext += 'hashtable.c'
endif
if build_res
srcs_xext += ['hashtable.c', 'xres.c']
srcs_xext += 'xres.c'
endif
if build_screensaver

View File

@ -96,6 +96,8 @@ nettle_dep = dependency('nettle')
dbus_required = get_option('systemd_logind') == 'true'
dbus_dep = dependency('dbus-1', version: '>= 1.0', required: dbus_required)
build_hashtable = false
# Resolve default values of some options
xkb_dir = get_option('xkb_dir')
if xkb_dir == ''
@ -300,6 +302,9 @@ if not xdmcp_dep.found()
endif
build_glx = get_option('glx')
if build_glx
build_hashtable = true
endif
libdrm_dep = dependency('libdrm', version: '>= 2.4.89', required: false)
@ -363,6 +368,10 @@ endif
build_xf86bigfont = get_option('xf86bigfont')
build_screensaver = get_option('screensaver')
build_res = get_option('xres')
if build_res
build_hashtable = true
endif
build_xace = get_option('xace')
build_xinerama = get_option('xinerama')