From 13575ae3f332e33a1952a803f2392d6d70df2028 Mon Sep 17 00:00:00 2001
From: Sparky Bluefang <sparky@bluefang-logic.com>
Date: Wed, 2 Sep 2020 17:59:45 -0400
Subject: [PATCH] Fix meson syntax error when xinerama support is disabled.

Fixes #346
---
 libcscreensaver/meson.build | 7 ++++++-
 meson.build                 | 3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/libcscreensaver/meson.build b/libcscreensaver/meson.build
index 1800c46..c2c3757 100644
--- a/libcscreensaver/meson.build
+++ b/libcscreensaver/meson.build
@@ -145,13 +145,18 @@ gir_sources = [
   dbus_built
 ]
 
+libcscreensaver_deps = [gobject, gtk, gdk, x11, xrandr, xext, glib, gio, gthread, pam, m]
+if use_xinerama
+  libcscreensaver_deps += xinerama
+endif
+
 libcscreensaver = library(
   'cscreensaver',
   cscreensaver_sources + gir_sources,
   version: '0.0.0',
   include_directories: inc,
   cpp_args: '-DG_LOG_DOMAIN="CScreensaver"',
-  dependencies: [gobject, gtk, gdk, x11, xinerama, xrandr, xext, glib, gio, gthread, pam, m],
+  dependencies: libcscreensaver_deps,
   install: true
 )
 
diff --git a/meson.build b/meson.build
index b15c3fb..2f9a9a5 100644
--- a/meson.build
+++ b/meson.build
@@ -61,7 +61,8 @@ foreach sym : [
   endif
 endforeach
 
-if get_option('xinerama')
+use_xinerama = get_option('xinerama')
+if use_xinerama
   if host_machine.system() == 'solaris'
     xinerama = cc.find_library('Xext')
     xinerama_h = cc.has_header('X11/extensions/xinerama.h')
