Changeset 0cd3720


Ignore:
Timestamp:
Jul 2, 2020, 2:49:15 PM (4 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe, fix/ffmpeg5, master
Children:
1d60d90
Parents:
9f73538
Message:

[waf] add --nodeps option to build with no dependency

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    r9f73538 r0cd3720  
    4949            dest = 'build_type', const = 'debug',
    5050            help = 'build in debug mode (see --build-type)')
     51    ctx.add_option('--nodeps', action = 'store_const',
     52            dest = 'nodeps', const = 'debug',
     53            help = 'build with no external dependencies')
    5154    add_option_enable_disable(ctx, 'fftw3f', default = False,
    5255            help_str = 'compile with fftw3f instead of ooura (recommended)',
     
    127130        target_platform = ctx.options.target_platform
    128131
     132    if ctx.options.nodeps:
     133        external_deps = [
     134                'sndfile',
     135                'samplerate',
     136                'jack',
     137                'avcodec',
     138                'blas',
     139                'fftw3',
     140                'fftw3f',
     141        ]
     142        for d in external_deps:
     143            if not hasattr(ctx.options, 'enable_' + d):
     144                raise ctx.errors.ConfigurationError ('--enable-%s missing from options' % d)
     145            if getattr(ctx.options, 'enable_' + d) == True:
     146                msg = 'Option --nodeps can not be used along with --enable-%s' % d
     147                raise ctx.errors.ConfigurationError (msg)
     148            elif getattr(ctx.options, 'enable_' + d) is None:
     149                msg = 'Option --nodeps used but automatic detection with --enable-%s' % d
     150                ctx.msg('Warning', msg)
     151            setattr(ctx.options, 'enable_' + d, False)
     152
    129153    from waflib import Options
    130154
Note: See TracChangeset for help on using the changeset viewer.