build-sys: If X11 is found set HAVE_X11 for client-only builds.

Fix an issue where HAVE_X11 was only set for builds including the
daemon. This in effect disabled all X11 code from being used while still
building it and linking to X11 libraries.
This commit is contained in:
Arthur Taylor 2024-04-23 22:59:51 -07:00
parent c1990dd026
commit 4e34ea65c2

View file

@ -621,6 +621,11 @@ if libsystemd_dep.found()
endif
x11_dep = dependency('x11-xcb', required : get_option('x11'))
if x11_dep.found()
# Base X11 dependencies
xcb_dep = dependency('xcb', required : true, version : '>= 1.6')
cdata.set('HAVE_X11', 1)
endif
# OSS support
if cc.has_header('sys/soundcard.h', required: get_option('oss-output'))
@ -751,11 +756,10 @@ if get_option('daemon')
endif
if x11_dep.found()
xcb_dep = dependency('xcb', required : true, version : '>= 1.6')
# Additional X11 dependencies required by x11-modules
ice_dep = dependency('ice', required : true)
sm_dep = dependency('sm', required : true)
xtst_dep = dependency('xtst', required : true)
cdata.set('HAVE_X11', 1)
if cc.has_function('XSetIOErrorExitHandler', dependencies: x11_dep)
cdata.set('HAVE_XSETIOERROREXITHANDLER', 1)
endif