Fix compile warnings on OS X.
[dcpomatic.git] / wscript
diff --git a/wscript b/wscript
index 6a4854052ab6ea2176f2290e31ad3fcae41edea9..638f8f2fa14477a7e7caff4809b7c27f86956da7 100644 (file)
--- a/wscript
+++ b/wscript
@@ -29,14 +29,14 @@ from waflib import Logs, Context
 APPNAME = 'dcpomatic'
 
 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 --abbrev=0'), stdout=subprocess.PIPE).communicate()[0]
+last_version = subprocess.Popen(shlex.split('git describe --tags --abbrev=0'), stdout=subprocess.PIPE).communicate()[0]
 
 if this_version == '':
     VERSION = '%sdevel' % last_version[1:].strip()
 else:
     VERSION = this_version[1:].strip()
 
-print 'Version: %s' % VERSION
+print('Version: %s' % VERSION)
 
 def options(opt):
     opt.load('compiler_cxx')
@@ -63,6 +63,7 @@ def options(opt):
 
 def configure(conf):
     conf.load('compiler_cxx')
+    conf.load('clang_compilation_database', tooldir=['waf-tools'])
     if conf.options.target_windows:
         conf.load('winres')
 
@@ -147,7 +148,6 @@ def configure(conf):
     # POSIX
     if conf.env.TARGET_LINUX or conf.env.TARGET_OSX:
         conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_POSIX')
-        conf.env.append_value('CXXFLAGS', ['-Wunsafe-loop-optimizations', '-Wlogical-op'])
         boost_lib_suffix = ''
         boost_thread = 'boost_thread'
         conf.env.append_value('LINKFLAGS', '-pthread')
@@ -158,6 +158,7 @@ def configure(conf):
         conf.env.append_value('CXXFLAGS', '-DLINUX_LOCALE_PREFIX="%s/share/locale"' % conf.env['INSTALL_PREFIX'])
         conf.env.append_value('CXXFLAGS', '-DLINUX_SHARE_PREFIX="%s/share/dcpomatic2"' % conf.env['INSTALL_PREFIX'])
         conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_LINUX')
+        conf.env.append_value('CXXFLAGS', ['-Wunsafe-loop-optimizations', '-Wlogical-op'])
         if not conf.env.DISABLE_GUI:
             conf.check_cfg(package='gtk+-2.0', args='--cflags --libs', uselib_store='GTK', mandatory=True)
 
@@ -646,7 +647,7 @@ def dist(ctx):
     ctx.excl = """
                TODO core *~ src/wx/*~ src/lib/*~ builds/*~ doc/manual/*~ src/tools/*~ *.pyc .waf* build .git
                deps alignment hacks sync *.tar.bz2 *.exe .lock* *build-windows doc/manual/pdf doc/manual/html
-               GRSYMS GRTAGS GSYMS GTAGS
+               GRSYMS GRTAGS GSYMS GTAGS compile_commands.json
                """
 
 def create_version_cc(version, cxx_flags):