Changeset 4cbc6e9


Ignore:
Timestamp:
Dec 24, 2016, 10:35:48 AM (4 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, sampler, yinfft+
Children:
e79943b
Parents:
93bd9a7 (diff), b4ce693 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'waf-build-tweaks' of https://github.com/emuell/aubio

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    r93bd9a7 r4cbc6e9  
    4848
    4949def options(ctx):
     50    ctx.add_option('--build-type', action = 'store',
     51            default = "release",
     52            choices = ('debug', 'release'),
     53            dest = 'build_type',
     54            help = 'whether to compile with (--build_type=release) or without (--build_type=debug) '\
     55              ' compiler opimizations [default: release]')
    5056    add_option_enable_disable(ctx, 'fftw3f', default = False,
    5157            help_str = 'compile with fftw3f instead of ooura (recommended)',
     
    126132    ctx.env['DEST_OS'] = target_platform
    127133
     134    if ctx.options.build_type == "debug":
     135        ctx.define('DEBUG', 1)
     136    else:
     137        ctx.define('NDEBUG', 1)
     138   
    128139    if ctx.env.CC_NAME != 'msvc':
     140        # enable debug symbols and configure warnings
    129141        ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra']
    130     else:
    131         ctx.env.CFLAGS += ['/W4', '/MD']
    132         ctx.env.CFLAGS += ['/D_CRT_SECURE_NO_WARNINGS']
    133 
     142        if ctx.options.build_type == "release":
     143            # set optimization level
     144            ctx.env.CFLAGS += ['-O2']
     145    else:
     146        # enable debug symbols
     147        ctx.env.CFLAGS += ['/Z7', '/FS']
     148        ctx.env.LINKFLAGS += ['/DEBUG', '/INCREMENTAL:NO']
     149        # configure warnings
     150        ctx.env.CFLAGS += ['/W4', '/D_CRT_SECURE_NO_WARNINGS']
     151        # set optimization level and runtime libs
     152        if (ctx.options.build_type == "release"):
     153            ctx.env.CFLAGS += ['/Ox']
     154            ctx.env.CFLAGS += ['/MD']
     155        else:
     156            assert(ctx.options.build_type == "debug")
     157            ctx.env.CFLAGS += ['/MDd']
     158       
    134159    ctx.check_cc(lib='m', uselib_store='M', mandatory=False)
    135160
Note: See TracChangeset for help on using the changeset viewer.