aboutsummaryrefslogtreecommitdiff
path: root/emscons
diff options
context:
space:
mode:
authorAndreas Bergmeier <andreas.bergmeier@gmx.net>2013-05-20 10:21:49 +0200
committerAndreas Bergmeier <andreas.bergmeier@gmx.net>2013-05-20 10:23:42 +0200
commitc013660606d8c3813ce5ca2437ee2a7cb209adaf (patch)
treee2edeb0cc23dc096a030924319a0ff35f822b17e /emscons
parent6346adec3b5f59415d9eb9650eeefd4120f32763 (diff)
Add new wrapper emscons, which sets EMSCRIPTEN_TOOL_PATH in environment.
This way the Emscripten Tool no longer has to be copied to root build directory.
Diffstat (limited to 'emscons')
-rwxr-xr-xemscons20
1 files changed, 20 insertions, 0 deletions
diff --git a/emscons b/emscons
new file mode 100755
index 00000000..2666f18c
--- /dev/null
+++ b/emscons
@@ -0,0 +1,20 @@
+#!/usr/bin/env python2
+
+'''
+Wrapping the scons invocation, EMSCRIPTEN_TOOL_PATH is set in the process
+environment, and can be used to locate the emscripten SCons Tool.
+Example:
+# Load emscripten Tool
+my_env = Environment(tools=['emscripten'], toolpath=[os.environ['EMSCRIPTEN_TOOL_PATH']])
+'''
+
+import os, subprocess, sys
+from tools import shared
+
+tool_path = os.path.join(shared.path_from_root('tools'), 'scons', 'site_scons', 'site_tools', 'emscripten')
+
+env = os.environ.copy()
+env[ 'EMSCRIPTEN_TOOL_PATH' ] = tool_path
+
+exit(subprocess.call(sys.argv[1:], env=env))
+