aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-12-16 16:24:39 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-12-16 16:24:39 -0800
commit4fb00853a9998374666c85d89c350782b9e45250 (patch)
tree5eddfb302a1875343866296dd334f2b6c2e35b24 /emcc
parent3b2466246537461a2d4811e93c659d23513d5408 (diff)
parent69317b35549ae38cf99c4c896d556803d58174cc (diff)
Merge pull request #1896 from juj/emrun
Emrun
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc12
1 files changed, 12 insertions, 0 deletions
diff --git a/emcc b/emcc
index 9a58094b..1d78baf8 100755
--- a/emcc
+++ b/emcc
@@ -499,6 +499,11 @@ Options that are modified or new in %s include:
--proxy-to-worker Generates both html and js files. The main
program is in js, and the html proxies to/from it.
+ --emrun Enables the generated output to be aware of the
+ emrun command line tool. This allows stdout, stderr
+ and exit(returncode) capture when running the
+ generated application through emrun.
+
The target file, if specified (-o <target>), defines what will
be generated:
@@ -774,6 +779,7 @@ try:
shell_path = shared.path_from_root('src', 'shell.html')
js_libraries = []
bind = False
+ emrun = False
jcache = False
save_bc = False
memory_init_file = False
@@ -963,12 +969,18 @@ try:
if not absolute_warning_shown and os.path.isabs(path_name):
logging.warning ('-I or -L of an absolute path "' + newargs[i] + '" encountered. If this is to a local system header/library, it may cause problems (local system files make sense for compiling natively on your system, but not necessarily to JavaScript). Pass \'-Wno-warn-absolute-paths\' to emcc to hide this warning.') # Of course an absolute path to a non-system-specific library or header is fine, and you can ignore this warning. The danger are system headers that are e.g. x86 specific and nonportable. The emscripten bundled headers are modified to be portable, local system ones are generally not
absolute_warning_shown = True
+ elif newargs[i] == '--emrun':
+ emrun = True
+ newargs[i] = ''
newargs = [ arg for arg in newargs if arg is not '' ]
# If user did not specify a default -std for C++ code, specify the emscripten default.
if default_cxx_std:
newargs = newargs + [default_cxx_std]
+ if emrun:
+ post_js += open(shared.path_from_root('src', 'emrun_postjs.js')).read() + '\n'
+
if js_opts is None: js_opts = opt_level >= 2
if llvm_opts is None: llvm_opts = LLVM_OPT_LEVEL[opt_level]
if llvm_lto is None and opt_level >= 3: llvm_lto = 3