show warning if using emscripten.py directly
This commit is contained in:
Родитель
73ae38f0e7
Коммит
b8352dc221
|
@ -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):
|
||||
|
|
|
@ -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')
|
||||
|
|
Загрузка…
Ссылка в новой задаче