Skip to content

Commit

Permalink
[waf] add --nodeps option to build with no dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
piem committed Jul 2, 2020
1 parent 9f73538 commit 0cd3720
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions wscript
Expand Up @@ -48,6 +48,9 @@ def options(ctx):
ctx.add_option('--debug', action = 'store_const',
dest = 'build_type', const = 'debug',
help = 'build in debug mode (see --build-type)')
ctx.add_option('--nodeps', action = 'store_const',
dest = 'nodeps', const = 'debug',
help = 'build with no external dependencies')
add_option_enable_disable(ctx, 'fftw3f', default = False,
help_str = 'compile with fftw3f instead of ooura (recommended)',
help_disable_str = 'do not compile with fftw3f')
Expand Down Expand Up @@ -126,6 +129,27 @@ def configure(ctx):
if ctx.options.target_platform:
target_platform = ctx.options.target_platform

if ctx.options.nodeps:
external_deps = [
'sndfile',
'samplerate',
'jack',
'avcodec',
'blas',
'fftw3',
'fftw3f',
]
for d in external_deps:
if not hasattr(ctx.options, 'enable_' + d):
raise ctx.errors.ConfigurationError ('--enable-%s missing from options' % d)
if getattr(ctx.options, 'enable_' + d) == True:
msg = 'Option --nodeps can not be used along with --enable-%s' % d
raise ctx.errors.ConfigurationError (msg)
elif getattr(ctx.options, 'enable_' + d) is None:
msg = 'Option --nodeps used but automatic detection with --enable-%s' % d
ctx.msg('Warning', msg)
setattr(ctx.options, 'enable_' + d, False)

from waflib import Options

if target_platform=='emscripten':
Expand Down

0 comments on commit 0cd3720

Please sign in to comment.