aboutsummaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-10-15 08:49:39 +0200
committerDavid Robillard <d@drobilla.net>2020-10-16 18:22:58 +0200
commitd10bd6ccf92b3fa1726a93dd7f692d03d265782e (patch)
tree9673a3c14755763faf63c0af225813e57f218dd2 /wscript
parent06c0bc8af15f9b1d4e1def4ed1450107c1a5caa8 (diff)
downloadpugl-d10bd6ccf92b3fa1726a93dd7f692d03d265782e.tar.gz
pugl-d10bd6ccf92b3fa1726a93dd7f692d03d265782e.tar.bz2
pugl-d10bd6ccf92b3fa1726a93dd7f692d03d265782e.zip
Only build header warning test in strict mode
Diffstat (limited to 'wscript')
-rw-r--r--wscript78
1 files changed, 40 insertions, 38 deletions
diff --git a/wscript b/wscript
index dcae5c3..46bed4f 100644
--- a/wscript
+++ b/wscript
@@ -208,7 +208,8 @@ def configure(conf):
conf.env.update({
'BUILD_SHARED': not Options.options.no_shared,
- 'BUILD_STATIC': conf.env.BUILD_TESTS or not Options.options.no_static})
+ 'BUILD_STATIC': conf.env.BUILD_TESTS or not Options.options.no_static,
+ 'BUILD_STRICT_HEADER_TEST': Options.options.strict})
if conf.env.TARGET_PLATFORM == 'win32':
conf.env.PUGL_PLATFORM = 'win'
@@ -466,44 +467,45 @@ def build(bld):
'pugl_%s_gl_static' % platform],
uselib = deps[platform]['uselib'] + ['CAIRO'])
- # Make a hyper strict warning environment for checking API headers
- strict_env = bld.env.derive()
- autowaf.remove_all_warning_flags(strict_env)
- autowaf.enable_all_warnings(strict_env)
- autowaf.set_warnings_as_errors(strict_env)
- autowaf.add_compiler_flags(strict_env, '*', {
- 'clang': ['-Wno-padded'],
- 'gcc': ['-Wno-padded', '-Wno-suggest-attribute=const'],
- 'msvc': [
- '/wd4514', # unreferenced inline function has been removed
- '/wd4820', # padding added after construct
- ],
- })
- autowaf.add_compiler_flags(strict_env, 'cxx', {
- 'clang': ['-Wno-documentation-unknown-command'],
- 'msvc': [
- '/wd4355', # 'this' used in base member initializer list
- '/wd4571', # structured exceptions (SEH) are no longer caught
- ],
- })
+ if bld.env.BUILD_STRICT_HEADER_TEST:
+ # Make a hyper strict warning environment for checking API headers
+ strict_env = bld.env.derive()
+ autowaf.remove_all_warning_flags(strict_env)
+ autowaf.enable_all_warnings(strict_env)
+ autowaf.set_warnings_as_errors(strict_env)
+ autowaf.add_compiler_flags(strict_env, '*', {
+ 'clang': ['-Wno-padded'],
+ 'gcc': ['-Wno-padded', '-Wno-suggest-attribute=const'],
+ 'msvc': [
+ '/wd4514', # unreferenced inline function has been removed
+ '/wd4820', # padding added after construct
+ ],
+ })
+ autowaf.add_compiler_flags(strict_env, 'cxx', {
+ 'clang': ['-Wno-documentation-unknown-command'],
+ 'msvc': [
+ '/wd4355', # 'this' used in base member initializer list
+ '/wd4571', # structured exceptions (SEH) are no longer caught
+ ],
+ })
- # Check that C headers build with (almost) no warnings
- bld(features = 'c cprogram',
- source = 'test/test_build.c',
- target = 'test/test_build_c',
- install_path = '',
- env = strict_env,
- use = ['pugl_%s_static' % platform],
- uselib = deps[platform]['uselib'] + ['CAIRO'])
-
- # Check that C++ headers build with (almost) no warnings
- bld(features = 'cxx cxxprogram',
- source = 'test/test_build.cpp',
- target = 'test/test_build_cpp',
- install_path = '',
- env = strict_env,
- use = ['pugl_%s_static' % platform],
- uselib = deps[platform]['uselib'] + ['CAIRO'])
+ # Check that C headers build with (almost) no warnings
+ bld(features = 'c cprogram',
+ source = 'test/test_build.c',
+ target = 'test/test_build_c',
+ install_path = '',
+ env = strict_env,
+ use = ['pugl_%s_static' % platform],
+ uselib = deps[platform]['uselib'] + ['CAIRO'])
+
+ # Check that C++ headers build with (almost) no warnings
+ bld(features = 'cxx cxxprogram',
+ source = 'test/test_build.cpp',
+ target = 'test/test_build_cpp',
+ install_path = '',
+ env = strict_env,
+ use = ['pugl_%s_static' % platform],
+ uselib = deps[platform]['uselib'] + ['CAIRO'])
if bld.env.CXX and bld.env.HAVE_GL:
build_example('pugl_cxx_demo', ['examples/pugl_cxx_demo.cpp'],