Changeset 5b194f0 for wscript


Ignore:
Timestamp:
Oct 1, 2017, 3:27:07 AM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
Children:
16c12a1, 2a4ce6d
Parents:
2f02d51 (diff), 873646d (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 'PR/simplify_emscripten'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    r2f02d51 r5b194f0  
    103103
    104104def configure(ctx):
    105     from waflib import Options
    106     ctx.load('compiler_c')
    107     ctx.load('waf_unit_test')
    108     ctx.load('gnu_dirs')
    109 
    110105    target_platform = sys.platform
    111106    if ctx.options.target_platform:
    112107        target_platform = ctx.options.target_platform
    113108
     109    from waflib import Options
    114110
    115111    if target_platform=='emscripten':
    116         # need to force spaces between flag -o and path
    117         # inspired from :
    118         # https://github.com/waf-project/waf/blob/master/waflib/extras/c_emscripten.py (#1885)
    119         # (OSX /emscripten 1.37.9)
    120         ctx.env.CC_TGT_F            = ['-c', '-o', '']
    121         ctx.env.CCLNK_TGT_F         = ['-o', '']
     112        ctx.load('c_emscripten')
     113    else:
     114        ctx.load('compiler_c')
     115
     116    ctx.load('waf_unit_test')
     117    ctx.load('gnu_dirs')
     118
    122119    # check for common headers
    123120    ctx.check(header_name='stdlib.h')
     
    152149    else:
    153150        # enable debug symbols
    154         ctx.env.CFLAGS += ['/Z7', '/FS']
     151        ctx.env.CFLAGS += ['/Z7']
     152        # /FS flag available in msvc >= 12 (2013)
     153        if 'MSVC_VERSION' in ctx.env and ctx.env.MSVC_VERSION >= 12:
     154            ctx.env.CFLAGS += ['/FS']
    155155        ctx.env.LINKFLAGS += ['/DEBUG', '/INCREMENTAL:NO']
    156156        # configure warnings
     
    227227
    228228    if target_platform == 'emscripten':
    229         import os.path
    230         ctx.env.CFLAGS += [ '-I' + os.path.join(os.environ['EMSCRIPTEN'], 'system', 'include') ]
    231        
    232229        if ctx.options.build_type == "debug":
    233230            ctx.env.cshlib_PATTERN = '%s.js'
     
    250247        from python.lib.gen_external import get_c_declarations, get_cpp_objects_from_c_declarations, get_all_func_names_from_lib, generate_lib_from_c_declarations
    251248        c_decls = get_c_declarations(usedouble=False)  # emscripten can't use double
    252         objects = get_cpp_objects_from_c_declarations(c_decls)
     249        objects = list(get_cpp_objects_from_c_declarations(c_decls))
    253250        # ensure that aubio structs are exported
    254251        objects += ['fvec_t', 'cvec_t', 'fmat_t']
     
    447444    # add sub directories
    448445    if bld.env['DEST_OS'] not in ['ios', 'iosimulator', 'android']:
     446        if bld.env['DEST_OS']=='emscripten' and not bld.options.testcmd:
     447            bld.options.testcmd = 'node %s'
    449448        bld.recurse('examples')
    450449        bld.recurse('tests')
Note: See TracChangeset for help on using the changeset viewer.