Take thumbprint rather than a full dcp::Certificate for trusted devices.
[libdcp.git] / wscript
diff --git a/wscript b/wscript
index 47085046b2b3ac8b8012aa1897ede5445d27d362..1d35e9ac43936b0e821f1c728ad11f245a6e2d85 100644 (file)
--- a/wscript
+++ b/wscript
 import subprocess
 import os
 import sys
+import shlex
 import distutils.spawn
 from waflib import Logs, Context
 
 APPNAME = 'libdcp'
-VERSION = '1.4.4devel'
+
+this_version = subprocess.Popen(shlex.split('git tag -l --points-at HEAD'), stdout=subprocess.PIPE).communicate()[0]
+last_version = subprocess.Popen(shlex.split('git describe --tags --abbrev=0'), stdout=subprocess.PIPE).communicate()[0]
+
+if isinstance(this_version, bytes):
+    this_version = this_version.decode('UTF-8')
+if isinstance(last_version, bytes):
+    last_version = last_version.decode('UTF-8')
+
+if this_version == '':
+    VERSION = '%sdevel' % last_version[1:].strip()
+else:
+    VERSION = this_version[1:].strip()
+
 API_VERSION = '-1.0'
 
 def options(opt):
@@ -55,6 +69,7 @@ def options(opt):
 
 def configure(conf):
     conf.load('compiler_cxx')
+    conf.load('clang_compilation_database', tooldir=['waf-tools'])
     conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-D_FILE_OFFSET_BITS=64', '-D__STDC_FORMAT_MACROS'])
     if conf.options.force_cpp11:
         conf.env.append_value('CXXFLAGS', ['-std=c++11', '-DBOOST_NO_CXX11_SCOPED_ENUMS'])