diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-04-13 18:57:41 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-04-13 18:57:41 -0700 |
commit | b5e53f4e1759ad04d2d1fcd841c1164ceab4364c (patch) | |
tree | 891320d479366f8a02fc4f82c90fb5c2f75771e9 /emcc | |
parent | 02b5bd72bd7b4248d0f57595f511a7371f836ae4 (diff) |
--js-library option to make it easy to add additional library_*.js files
Diffstat (limited to 'emcc')
-rwxr-xr-x | emcc | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -269,6 +269,9 @@ Options that are modified or new in %s include: target other than HTML is specified using the -o option. + --js-library <lib> A JavaScript library to use in addition to + those in Emscripten's src/library_* + The target file, if specified (-o <target>), defines what will be generated: @@ -437,6 +440,7 @@ try: compression = None ignore_dynamic_linking = False shell_path = shared.path_from_root('src', 'shell.html') + js_libraries = [] def check_bad_eq(arg): assert '=' not in arg, 'Invalid parameter (do not use "=" with "--" options)' @@ -514,6 +518,11 @@ try: shell_path = newargs[i+1] newargs[i] = '' newargs[i+1] = '' + elif newargs[i].startswith('--js-library'): + check_bad_eq(newargs[i]) + js_libraries.append(newargs[i+1]) + newargs[i] = '' + newargs[i+1] = '' newargs = [ arg for arg in newargs if arg is not '' ] if llvm_opts is None: llvm_opts = LLVM_OPT_LEVEL[opt_level] @@ -843,7 +852,8 @@ try: # Emscripten if DEBUG: print >> sys.stderr, 'emcc: LLVM => JS' - final = shared.Building.emscripten(final, append_ext=False) + extra_args = [] if not js_libraries else ['--libraries', ','.join(map(os.path.abspath, js_libraries))] + final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args) if DEBUG: save_intermediate('original') # Embed and preload files |