From 4221e40199086dcab8e901f581194a0a8fd9806c Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 2 Apr 2020 14:17:38 +0200 Subject: Tidy up by using option_defaults. --- cscript | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cscript') diff --git a/cscript b/cscript index 2cdf3149..c3ce3d9d 100644 --- a/cscript +++ b/cscript @@ -34,16 +34,17 @@ import os import shutil +option_defaults = { 'force-cpp11': False, 'jpeg': 'oj2' } + def dependencies(target, options): - if (target.platform == 'windows' and target.version == 'xp') or (options is not None and 'jpeg' in options and options['jpeg'] == 'oj1'): + if (target.platform == 'windows' and target.version == 'xp') or options['jpeg'] == 'oj1': return (('libcxml', '0d18df4'), ('openjpeg', 'f166257'), ('asdcplib', 'carl')) else: return (('libcxml', '0d18df4'), ('openjpeg', '956af06'), ('asdcplib', 'carl')) def build(target, options): cmd = './waf configure --disable-examples --prefix=%s' % target.directory - if options is not None and 'jpeg' in options: - cmd += ' --jpeg=%s' % options['jpeg'] + cmd += ' --jpeg=%s' % options['jpeg'] if target.platform == 'linux': cmd += ' --static' if not (target.distro == 'ubuntu' and target.version == '18.04'): @@ -69,7 +70,7 @@ def build(target, options): if target.debug: cmd += ' --enable-debug' - if options is not None and 'force-cpp11' in options and options['force-cpp11']: + if options['force-cpp11']: cmd += ' --force-cpp11' target.command(cmd) -- cgit v1.2.3