X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=wscript;h=824cfa9dc4a3bc7b8f800c137db5bee581caf7fe;hb=b551048b6562c0697f8b748a2f0907dbd3d8fb96;hp=6ea7dedcb337434c7ef3bcc4873ef92a859dd868;hpb=2bf2c409730da51e4dde58e3d0918319715db7d7;p=dcpomatic.git diff --git a/wscript b/wscript index 6ea7dedcb..824cfa9dc 100644 --- a/wscript +++ b/wscript @@ -24,12 +24,18 @@ import sys import glob import distutils import distutils.spawn +try: + # python 2 + from urllib import urlencode +except ImportError: + # python 3 + from urllib.parse import urlencode 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() @@ -41,7 +47,7 @@ print('Version: %s' % VERSION) def options(opt): opt.load('compiler_cxx') opt.load('winres') - + opt.add_option('--enable-debug', action='store_true', default=False, help='build with debugging information and without optimisation') opt.add_option('--disable-gui', action='store_true', default=False, help='disable building of GUI tools') opt.add_option('--disable-tests', action='store_true', default=False, help='disable building of tests') @@ -148,7 +154,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') @@ -159,6 +164,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) @@ -601,7 +607,8 @@ def configure(conf): Logs.pprint('YELLOW', '') def download_supporters(): - os.system('curl https://dcpomatic.com/supporters.cc > build/supporters.cc') + last_date = subprocess.Popen(shlex.split('git log -1 --format=%%ai %s' % last_version), stdout=subprocess.PIPE).communicate()[0] + os.system('curl https://dcpomatic.com/supporters.cc?%s > src/wx/supporters.cc' % urlencode({"until": last_date.strip()})) def build(bld): create_version_cc(VERSION, bld.env.CXXFLAGS) @@ -647,7 +654,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):