diff options
-rwxr-xr-x | emcc | 4 | ||||
-rw-r--r-- | src/settings.js | 5 |
2 files changed, 7 insertions, 2 deletions
@@ -1837,7 +1837,7 @@ try: js_target = unsuffixed(target) + '.js' base_js_target = os.path.basename(js_target) if proxy_to_worker: - html.write(shell.replace('{{{ SCRIPT }}}', '<script>' + open(shared.path_from_root('src', 'webGLClient.js')).read() + '\n' + open(shared.path_from_root('src', 'proxyClient.js')).read().replace('{{{ filename }}}', target_basename) + '</script>')) + html.write(shell.replace('{{{ SCRIPT }}}', '<script>' + open(shared.path_from_root('src', 'webGLClient.js')).read() + '\n' + open(shared.path_from_root('src', 'proxyClient.js')).read().replace('{{{ filename }}}', shared.Settings.PROXY_TO_WORKER_FILENAME or target_basename) + '</script>')) shutil.move(final, js_target) elif not Compression.on: # Normal code generation path @@ -1984,7 +1984,7 @@ try { if debug_level >= 4: generate_source_map(target) if proxy_to_worker: worker_target_basename = target_basename + '.worker' - open(target, 'w').write(open(shared.path_from_root('src', 'webGLClient.js')).read() + '\n' + open(shared.path_from_root('src', 'proxyClient.js')).read().replace('{{{ filename }}}', worker_target_basename)) + open(target, 'w').write(open(shared.path_from_root('src', 'webGLClient.js')).read() + '\n' + open(shared.path_from_root('src', 'proxyClient.js')).read().replace('{{{ filename }}}', shared.Settings.PROXY_TO_WORKER_FILENAME or worker_target_basename)) shutil.move(final, target[:-3] + '.worker.js') else: # copy final JS to output normally diff --git a/src/settings.js b/src/settings.js index 26883051..14077efd 100644 --- a/src/settings.js +++ b/src/settings.js @@ -422,9 +422,14 @@ var RUNTIME_LINKED_LIBS = []; // If this is a main file (BUILD_AS_SHARED_LIB == // linked libraries can break things. var BUILD_AS_WORKER = 0; // If set to 1, this is a worker library, a special kind of library // that is run in a worker. See emscripten.h + var PROXY_TO_WORKER = 0; // If set to 1, we build the project into a js file that will run // in a worker, and generate an html file that proxies input and // output to/from it. +var PROXY_TO_WORKER_FILENAME = ''; // If set, the script file name the main thread loads. + // Useful if your project doesn't run the main emscripten- + // generated script immediately but does some setup before + var LINKABLE = 0; // If set to 1, this file can be linked with others, either as a shared // library or as the main file that calls a shared library. To enable that, // we will not internalize all symbols and cull the unused ones, in other |