[shotwell] meson: Only add unity as a dependency if found



commit 47f9273fb87d65f66002f659fca1632bf7c67ad4
Author: Jens Georg <mail jensge org>
Date:   Thu Jun 22 11:56:25 2017 +0200

    meson: Only add unity as a dependency if found

 meson.build     |    2 ++
 src/meson.build |   12 +++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/meson.build b/meson.build
index 1a7c59c..53e4566 100644
--- a/meson.build
+++ b/meson.build
@@ -56,7 +56,9 @@ libraw = dependency('libraw', version : '>= 0.13.2')
 libexif = dependency('libexif', version : '>= 0.6.16')
 unity = dependency('unity', required : false)
 
+unity_available = false
 if unity.found() and get_option('enable-unity-support')
+  unity_available = true
   add_global_arguments(['--define=UNITY_SUPPORT'], language : 'vala')
 endif
 
diff --git a/src/meson.build b/src/meson.build
index a61e9a6..be31146 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -11,6 +11,14 @@ sw_graphics_processor = static_library('shotwell-graphics-processor',
                vala_args : '--disable-assert',
                install : false)
 
+
+shotwell_deps = [gio, gee, sqlite, gtk, sqlite, posix, gphoto2,
+                 gstreamer_pbu, gio_unix, gudev, gexiv2, gmodule,
+                 libraw, libexif, sw_plugin]
+if unity_available
+    shotwell_deps += [unity]
+endif
+
 executable('shotwell',
            ['unit/Unit.vala',
             'util/Util.vala',
@@ -202,9 +210,7 @@ executable('shotwell',
             '.unitize/_Library_unitize_entry.vala',
             '.unitize/_Direct_unitize_entry.vala'] + shotwell_resources,
            include_directories : vapi_incdir,
-           dependencies : [gio, gee, sqlite, gtk, sqlite, posix, gphoto2,
-                           gstreamer_pbu, gio_unix, gudev, gexiv2, gmodule,
-                           libraw, libexif, sw_plugin, unity],
+           dependencies : shotwell_deps,
            vala_args : ['--pkg', 'libgphoto2',
                         '--pkg', 'libraw',
                         '--pkg', 'libexif',


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