Changeset 4b084a9 for wscript


Ignore:
Timestamp:
May 30, 2017, 5:22:26 PM (2 years ago)
Author:
Martin Hermant <martin.hermant@gmail.com>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master
Children:
6421221
Parents:
dad51ce
Message:

wscript : emscripten

add NO_FILESYSTEM flag for lib export
add fmat and cvec functions to exported

fix indent error on enable_atlas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    rdad51ce r4b084a9  
    238238            ctx.env.LINKFLAGS += ['-Oz']
    239239            ctx.env.cshlib_PATTERN = '%s.min.js'
    240        
    241          # import exposed function names
    242         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
    243         c_decls = get_c_declarations(usedouble=False) #emscripten can't use double
    244         objects = get_cpp_objects_from_c_declarations(c_decls)
    245         objects+=['fvec_t']
    246         lib =  generate_lib_from_c_declarations(objects,c_decls)
    247         exported_funcnames = get_all_func_names_from_lib(lib)
    248         c_mangled_names = ['_'+s for s in exported_funcnames]
    249         ctx.env.LINKFLAGS_cshlib += ['-s','EXPORTED_FUNCTIONS=%s'%c_mangled_names]
    250         # put memory file inside generated js files
    251         ctx.env.LINKFLAGS+=['--memory-init-file','0']
     240
     241        # lib doesnt ship file system support
     242        ctx.env.LINKFLAGS_cshlib += ['-s', 'NO_FILESYSTEM=1']
     243        # put memory file inside generated js files for easier portability
     244        ctx.env.LINKFLAGS += ['--memory-init-file', '0']
    252245        ctx.env.cprogram_PATTERN = "%s.js"
    253246        ctx.env.cstlib_PATTERN = '%s.a'
    254         if (ctx.options.enable_atlas != True):
    255             ctx.options.enable_atlas = False
     247
     248        # get exposed functions
     249        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
     250        c_decls = get_c_declarations(usedouble=False)  # emscripten can't use double
     251        objects = get_cpp_objects_from_c_declarations(c_decls)
     252        # ensure that aubio structs are exported
     253        objects += ['fvec_t', 'cvec_t', 'fmat_t']
     254        lib = generate_lib_from_c_declarations(objects, c_decls)
     255        exported_funcnames = get_all_func_names_from_lib(lib)
     256        c_mangled_names = ['_' + s for s in exported_funcnames]
     257        ctx.env.LINKFLAGS_cshlib += ['-s', 'EXPORTED_FUNCTIONS=%s' % c_mangled_names]
     258
     259    if (ctx.options.enable_atlas != True):
     260        ctx.options.enable_atlas = False
    256261
    257262    # check support for C99 __VA_ARGS__ macros
Note: See TracChangeset for help on using the changeset viewer.