aboutsummaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-04-14 18:03:16 +0200
committerDavid Robillard <d@drobilla.net>2019-04-14 18:24:08 +0200
commit7887266eaf79f020dae2dd0126dbf732e167a751 (patch)
tree3a22565bc33f5b15c191d8585bc84599836c33f7 /wscript
parentee834a83860e614d565f5bb38cdfb8681ffa5f16 (diff)
parent4806680e7b17a83c14ea2b64c8ab6277a8b380b1 (diff)
downloadpugl-7887266eaf79f020dae2dd0126dbf732e167a751.tar.gz
pugl-7887266eaf79f020dae2dd0126dbf732e167a751.tar.bz2
pugl-7887266eaf79f020dae2dd0126dbf732e167a751.zip
Update autowaf
Diffstat (limited to 'wscript')
-rw-r--r--wscript34
1 files changed, 18 insertions, 16 deletions
diff --git a/wscript b/wscript
index 9bb55f3..5b3b3d2 100644
--- a/wscript
+++ b/wscript
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import sys
+
from waflib import Options, TaskGen
from waflib.extras import autowaf
@@ -17,33 +18,31 @@ VERSION = PUGL_VERSION # Package version for waf dist
top = '.' # Source directory
out = 'build' # Build directory
-def options(opt):
- opt.load('compiler_c')
- opt.load('compiler_cxx')
- autowaf.set_options(opt)
+def options(ctx):
+ ctx.load('compiler_c')
+ ctx.load('compiler_cxx')
- opt = opt.get_option_group('Configuration options')
- opt.add_option('--target', default=None, dest='target',
+ opts = ctx.configuration_options()
+ opts.add_option('--target', default=None, dest='target',
help='target platform (e.g. "win32" or "darwin")')
- autowaf.add_flags(
- opt,
+ ctx.add_flags(
+ opts,
{'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 keyboard issues by grabbing focus'})
def configure(conf):
conf.env.TARGET_PLATFORM = Options.options.target or sys.platform
- conf.load('compiler_c')
+ conf.load('compiler_c', cache=True)
+ conf.load('autowaf', cache=True)
+
if conf.env.TARGET_PLATFORM == 'win32':
- conf.load('compiler_cxx')
+ conf.load('compiler_cxx', cache=True)
- autowaf.configure(conf)
autowaf.set_c_lang(conf, 'c99')
- autowaf.display_header('Pugl Configuration')
if not Options.options.no_gl:
# TODO: Portable check for OpenGL
@@ -62,9 +61,9 @@ def configure(conf):
conf.define('PUGL_VERBOSE', 1)
# Shared library building is broken on win32 for some reason
- 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)
+ conf.env.update({
+ 'BUILD_SHARED': conf.env.TARGET_PLATFORM != 'win32',
+ 'BUILD_STATIC': conf.env['BUILD_TESTS'] or Options.options.static})
autowaf.set_lib_env(conf, 'pugl', PUGL_VERSION)
conf.write_config_header('pugl_config.h', remove=False)
@@ -174,6 +173,9 @@ def build(bld):
bld(features = 'doxygen',
doxyfile = 'Doxyfile')
+def test(tst):
+ pass
+
def lint(ctx):
"checks code for style issues"
import subprocess