[file-roller] meson: fixed errors when an optional dependency is not found



commit 78d3883128158bb26f53066c54061b5334b9b255
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Tue Oct 24 18:07:57 2017 +0200

    meson: fixed errors when an optional dependency is not found

 meson.build          |    1 +
 nautilus/meson.build |    4 ++--
 src/meson.build      |   10 +++++-----
 3 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/meson.build b/meson.build
index 4db639e..712b9cc 100644
--- a/meson.build
+++ b/meson.build
@@ -55,6 +55,7 @@ else
   use_libarchive = false
 endif
 
+use_magic = false
 if get_option('magic')
   libmagic_dep = c_comp.find_library('magic')
   if c_comp.compiles('''#include <magic.h>
diff --git a/nautilus/meson.build b/nautilus/meson.build
index c0f6ef3..c371e58 100644
--- a/nautilus/meson.build
+++ b/nautilus/meson.build
@@ -10,8 +10,8 @@ shared_module('nautilus-fileroller',
     gthread_dep, 
     gtk_dep, 
     libnautilus_extension_dep,
-    libjson_glib_dep,
-    libnotify_dep    
+    use_json_glib ? libjson_glib_dep : [],
+    use_libnotify ? libnotify_dep : []    
   ],  
   include_directories : config_inc,
   c_args : c_args,
diff --git a/src/meson.build b/src/meson.build
index 8e12e1d..fa1fcd3 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -90,10 +90,10 @@ executable('file-roller',
     glib_dep, 
     gthread_dep, 
     gtk_dep, 
-    libjson_glib_dep,
-    libnotify_dep,
-    libarchive_dep,
-    libmagic_dep
+    use_json_glib ? libjson_glib_dep : [],
+    use_libnotify ? libnotify_dep : [],
+    use_libarchive ? libarchive_dep : [],
+    use_magic ? libmagic_dep : []
   ],
   include_directories : config_inc,
   c_args : c_args,
@@ -107,7 +107,7 @@ executable('test-server', 'test-server.c',
     glib_dep, 
     gthread_dep, 
     gtk_dep, 
-    libjson_glib_dep
+    use_json_glib ? libjson_glib_dep : []
   ],  
   include_directories : config_inc,
   c_args : c_args,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]