diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-01-16 12:22:34 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-01-16 12:22:34 -0800 |
commit | abcc12003c814608f305b09044218996e1214ab1 (patch) | |
tree | 079837f7ef90168e1c72f39215213821d261bee4 /emscripten.py | |
parent | d53e12ae8e561ee1aecf76c48e2f4eff260af0d3 (diff) |
allow defining asm library functions, which are then included as if they were generated code
Diffstat (limited to 'emscripten.py')
-rwxr-xr-x | emscripten.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/emscripten.py b/emscripten.py index 2662e40a..e220e88f 100755 --- a/emscripten.py +++ b/emscripten.py @@ -248,6 +248,11 @@ def emscript(infile, settings, outfile, libraries=[]): for key, value in curr_forwarded_json['Functions']['unimplementedFunctions'].iteritems(): forwarded_json['Functions']['unimplementedFunctions'][key] = value + if settings.get('ASM_JS'): + parts = pre.split('// ASM_LIBRARY FUNCTIONS\n') + if len(parts) > 1: + pre = parts[0] + outputs.append([parts[1]]) funcs_js = ''.join([output[0] for output in outputs]) outputs = None |