Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added python/__init__.py
Empty file.
Empty file added python/lib/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion python/lib/gen_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def get_preprocessor():
print("Warning: could not guess preprocessor, using env's CC")
cpp_cmd = os.environ.get('CC', 'cc').split()
cpp_cmd += ['-E']
if 'emcc' in cpp_cmd:
if any('emcc' in f for f in cpp_cmd):
cpp_cmd += ['-x', 'c'] # emcc defaults to c++, force C language
return cpp_cmd

Expand Down
2 changes: 1 addition & 1 deletion scripts/build_emscripten
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ checkprog emmake
emconfigure ./waf configure --with-target-platform emscripten $*

# build
emmake ./waf build
emmake ./waf build --disable-tests --disable-examples --disable-docs
9 changes: 8 additions & 1 deletion wscript
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ def configure(ctx):
ctx.env.LINKFLAGS += ['-O0']
else:
ctx.env.LINKFLAGS += ['-Oz']
ctx.env.LINKFLAGS += ['-s','ASSERTIONS=0']
ctx.env.LINKFLAGS += ['-s','STRICT=1']
ctx.env.LINKFLAGS += ['-s','MODULARIZE=1']
ctx.env.LINKFLAGS += ['-s','EXPORT_NAME=aubio']
ctx.env.LINKFLAGS += ['-s','FILESYSTEM=0']
ctx.env.LINKFLAGS += ['-s','MALLOC=emmalloc']
ctx.env.cshlib_PATTERN = '%s.min.js'

# doesnt ship file system support in lib
Expand All @@ -283,9 +289,10 @@ def configure(ctx):
objects += ['fvec_t', 'cvec_t', 'fmat_t']
lib = generate_lib_from_c_declarations(objects, c_decls)
exported_funcnames = get_all_func_names_from_lib(lib)
c_mangled_names = ['_' + s for s in exported_funcnames]
c_mangled_names = [('_' + s).encode('utf8') for s in exported_funcnames]
ctx.env.LINKFLAGS_cshlib += ['-s',
'EXPORTED_FUNCTIONS=%s' % c_mangled_names]
ctx.env.LINKFLAGS_cshlib += ['-s', 'EXTRA_EXPORTED_RUNTIME_METHODS=["ccall", "cwrap"]']

# check support for C99 __VA_ARGS__ macros
check_c99_varargs = '''
Expand Down