aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-01-28 18:44:46 -0800
committerChad Austin <chad@imvu.com>2013-03-04 19:04:08 -0800
commiteff17663bc9460f1f760eaeb9be04450347eba1e (patch)
tree09623cbca6176fa146a42991f00d3b9a3890a141 /tools/shared.py
parentb32d0644551903091ad873b52fe9de920ea07020 (diff)
Pass configuration into emscript
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 1005a48d..585b2af2 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -304,6 +304,9 @@ CANONICAL_TEMP_DIR = os.path.join(TEMP_DIR, 'emscripten_temp')
class Configuration:
def __init__(self, environ):
self.DEBUG = environ.get('EMCC_DEBUG')
+ if self.DEBUG == "0":
+ self.DEBUG = None
+ self.DEBUG_CACHE = self.DEBUG and "cache" in self.DEBUG
self.EMSCRIPTEN_TEMP_DIR = None
if self.DEBUG:
@@ -314,11 +317,15 @@ class Configuration:
except Exception, e:
print >> sys.stderr, e, 'Could not create canonical temp dir. Check definition of TEMP_DIR in ~/.emscripten'
+ def debug_log(self, msg):
+ if self.DEBUG:
+ print >> sys.stderr, msg
+
configuration = Configuration(
environ=os.environ)
DEBUG = configuration.DEBUG
EMSCRIPTEN_TEMP_DIR = configuration.EMSCRIPTEN_TEMP_DIR
-DEBUG_CACHE = DEBUG and "cache" in DEBUG
+DEBUG_CACHE = configuration.DEBUG_CACHE
if not EMSCRIPTEN_TEMP_DIR:
EMSCRIPTEN_TEMP_DIR = tempfile.mkdtemp(prefix='emscripten_temp_', dir=TEMP_DIR)