aboutsummaryrefslogtreecommitdiff
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-09-15 11:37:06 +0200
committerDavid Robillard <d@drobilla.net>2018-09-15 11:44:26 +0200
commit8093902d95568f8de75aae763ca348783d483361 (patch)
treee6e76db582ce19a67eb6c5fbfbbbf5d068400018 /wscript
parentbdb65b8abcc402006ddb3e90e4a44fc1d0435ca2 (diff)
Clean up waf options
Diffstat (limited to 'wscript')
-rw-r--r--wscript30
1 files changed, 13 insertions, 17 deletions
diff --git a/wscript b/wscript
index 2b19152..3190c75 100644
--- a/wscript
+++ b/wscript
@@ -23,19 +23,17 @@ def options(opt):
autowaf.set_options(opt)
opt = opt.get_option_group('Configuration options')
- flags = {
- 'no-gl': 'do not build OpenGL support',
- 'no-cairo': 'do not build Cairo support',
- 'static': 'build static library',
- 'log': 'print GL information to console',
- 'grab-focus': 'work around reparent keyboard issues by grabbing focus'}
-
- for name, desc in flags.items():
- opt.add_option('--' + name, action='store_true',
- dest=name.replace('-', '_'), help=desc)
-
opt.add_option('--target', default=None, dest='target',
- help='Target platform (e.g. "win32" or "darwin")')
+ help='target platform (e.g. "win32" or "darwin")')
+
+ autowaf.add_flags(
+ opt,
+ {'no-gl': 'do not build OpenGL support',
+ 'no-cairo': 'do not build Cairo support',
+ 'static': 'build static library',
+ 'test': 'build test programs',
+ 'log': 'print GL information to console',
+ 'grab-focus': 'work around reparent keyboard issues by grabbing focus'})
def configure(conf):
conf.env.TARGET_PLATFORM = Options.options.target or sys.platform
@@ -64,11 +62,9 @@ def configure(conf):
autowaf.define(conf, 'PUGL_VERBOSE', 1)
# Shared library building is broken on win32 for some reason
- conf.env['BUILD_TESTS'] = Options.options.build_tests
- conf.env['BUILD_SHARED'] = (conf.env.TARGET_PLATFORM != 'win32' or
- Options.options.shared)
- conf.env['BUILD_STATIC'] = (Options.options.build_tests or
- Options.options.static)
+ conf.env['BUILD_TESTS'] = Options.options.test
+ conf.env['BUILD_SHARED'] = conf.env.TARGET_PLATFORM != 'win32'
+ conf.env['BUILD_STATIC'] = (Options.options.test or Options.options.static)
autowaf.define(conf, 'PUGL_VERSION', PUGL_VERSION)
conf.write_config_header('pugl_config.h', remove=False)