summaryrefslogtreecommitdiff
path: root/cscript
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-04-02 14:17:38 +0200
committerCarl Hetherington <cth@carlh.net>2020-04-02 14:17:38 +0200
commit4221e40199086dcab8e901f581194a0a8fd9806c (patch)
treeb24e341c653c44f4738ccf99d18105dcce3fd136 /cscript
parentbe3f1d914bbfd99e0676639d87c545dbe4d98526 (diff)
Tidy up by using option_defaults.
Diffstat (limited to 'cscript')
-rw-r--r--cscript9
1 files changed, 5 insertions, 4 deletions
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)