diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-02-05 10:37:40 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-02-05 10:37:40 -0800 |
commit | b8352dc2216113462f9e199644d11833d7ad2274 (patch) | |
tree | 11a714f71d13c4224da6a31de8747ad29d81994f | |
parent | 73ae38f0e759c57213d393218477348d5a3017c7 (diff) |
show warning if using emscripten.py directly
-rwxr-xr-x | emscripten.py | 9 | ||||
-rw-r--r-- | tools/shared.py | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/emscripten.py b/emscripten.py index 93df8823..5674c33a 100755 --- a/emscripten.py +++ b/emscripten.py @@ -15,8 +15,15 @@ import os import subprocess import re import sys -from tools import shared +if not os.environ.get('EMSCRIPTEN_SUPPRESS_USAGE_WARNING'): + print >> sys.stderr, ''' +============================================================== +WARNING: You should normally never use this! Use emcc instead. +============================================================== + ''' + +from tools import shared __rootpath__ = os.path.abspath(os.path.dirname(__file__)) def path_from_root(*pathelems): diff --git a/tools/shared.py b/tools/shared.py index c02c0ac3..dc84bce3 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -547,6 +547,9 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)'''.replace('$EMSCRIPTEN_ROOT', path_ @staticmethod def emscripten(filename, append_ext=True, extra_args=[]): + # Allow usage of emscripten.py without warning + os.environ['EMSCRIPTEN_SUPPRESS_USAGE_WARNING'] = '1' + # Run Emscripten settings = Settings.serialize() compiler_output = timeout_run(Popen(['python', EMSCRIPTEN, filename + ('.o.ll' if append_ext else ''), '-o', filename + '.o.js'] + settings + extra_args, stdout=PIPE), None, 'Compiling') |