meson: Fix build if Xdmcp is missing

Submitted by Thierry Reding on March 16, 2018, 1:28 p.m.

Details

Message ID 20180316132805.26254-1-thierry.reding@gmail.com
State New
Series "meson: Fix build if Xdmcp is missing"
Headers show

Commit Message

Thierry Reding March 16, 2018, 1:28 p.m.
From: Thierry Reding <treding@nvidia.com>

Xdmcp is an optional dependency, so make sure the build succeeds if it
is missing.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 include/meson.build | 4 ++--
 meson.build         | 8 +++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/include/meson.build b/include/meson.build
index e6abf22f81f7..b16dd6966c13 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -96,7 +96,7 @@  conf_data.set_quoted('SYSCONFDIR', join_paths(get_option('prefix'), get_option('
 # XXX: Stopped enumerating at COMPILEDEFAULTFONTPATH
 conf_data.set('XORG_VERSION_CURRENT', release)
 
-conf_data.set('HASXDMAUTH', get_option('xdm-auth-1'))
+conf_data.set('HASXDMAUTH', has_xdm_auth)
 conf_data.set('SECURE_RPC', get_option('secure-rpc'))
 
 conf_data.set('HAVE_DLFCN_H', cc.has_header('dlfcn.h'))
@@ -187,7 +187,7 @@  conf_data.set('SHAPE', '1')
 conf_data.set('XACE', build_xace)
 conf_data.set('XCMISC', '1')
 conf_data.set('XCSECURITY', build_xsecurity)
-conf_data.set('XDMCP', get_option('xdmcp'))
+conf_data.set('XDMCP', xdmcp_dep.found())
 conf_data.set('XF86BIGFONT', build_xf86bigfont)
 conf_data.set('XF86DRI', build_dri1)
 conf_data.set('XF86VIDMODE', build_xf86vidmode)
diff --git a/meson.build b/meson.build
index 32d72045b58c..c9e2c390cec1 100644
--- a/meson.build
+++ b/meson.build
@@ -272,11 +272,17 @@  endif
 # XXX: Add more sha1 options, because Linux is about choice
 sha1_dep = nettle_dep
 
-xdmcp_dep = []
+xdmcp_dep = dependency('', required : false)
 if get_option('xdmcp')
     xdmcp_dep = dependency('xdmcp')
 endif
 
+has_xdm_auth = get_option('xdm-auth-1')
+
+if not xdmcp_dep.found()
+  has_xdm_auth = false
+endif
+
 build_glx = get_option('glx')
 
 libdrm_dep = dependency('libdrm', version: '>= 2.4.89', required: false)