From 93a4035409ed5a4349c9848c3dae3ec670884ee0 Mon Sep 17 00:00:00 2001
From: Tetja Rediske <tetja+gitlab@tetja.de~>
Date: Sat, 19 Oct 2019 00:28:13 +0200
Subject: [PATCH] make non-gui variants build without avahi

---
 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f9efac8..8e10776e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -175,7 +175,7 @@ if (UNIX)
             link_directories("/usr/X11R6/lib")
         endif()
 
-        if (${PKG_CONFIG_FOUND})
+        if (BARRIER_BUILD_GUI AND ${PKG_CONFIG_FOUND})
             pkg_check_modules (AVAHI_COMPAT REQUIRED avahi-compat-libdns_sd)
             include_directories (BEFORE SYSTEM ${AVAHI_COMPAT_INCLUDE_DIRS})
             set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${AVAHI_COMPAT_INCLUDE_DIRS}")
-- 
2.24.1

