[gnome-multi-writer] Allow compiling with newer versions of meson



commit b4ad845b85a72a8a4109eac37952d360014db203
Author: Richard Hughes <richard hughsie com>
Date:   Wed Jun 14 07:59:56 2017 +0100

    Allow compiling with newer versions of meson
    
    In 0.41.0 meson introduced it's own 'dist' target and so we don't need to
    define this ourselves anymore. Use a version compare to avoid depending on a
    very new meson.

 meson.build |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)
---
diff --git a/meson.build b/meson.build
index 0e4d999..73d6bf5 100644
--- a/meson.build
+++ b/meson.build
@@ -106,21 +106,23 @@ subdir('man')
 subdir('po')
 subdir('data')
 
-archiver = find_program('git', required : false)
-if archiver.found()
-  run_target('dist',
-    # git config tar.tar.xz.command "xz -c"
-    command: [
-      'git', 'archive',
-      '--prefix=' + meson.project_name() + '-' + meson.project_version() + '/',
-      'HEAD',
-      '--format=tar.xz',
-      '--output',
-      meson.project_name() + '-' + meson.project_version() + '.tar.xz'
-    ]
-  )
-else
-  message('git not found, you will not be able to run `ninja dist`')
+if meson.version().version_compare('<0.41.0')
+  archiver = find_program('git', required : false)
+  if archiver.found()
+    run_target('dist',
+      # git config tar.tar.xz.command "xz -c"
+      command: [
+        'git', 'archive',
+        '--prefix=' + meson.project_name() + '-' + meson.project_version() + '/',
+        'HEAD',
+        '--format=tar.xz',
+        '--output',
+        meson.project_name() + '-' + meson.project_version() + '.tar.xz'
+      ]
+    )
+  else
+    message('git not found, you will not be able to run `ninja dist`')
+  endif
 endif
 
 appstream_util = find_program('appstream-util', required : false)


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