Skip to content

Commit

Permalink
Fix discrepancy in emcmake vs emconfigure scripts that CMAKE_CROSSCOM…
Browse files Browse the repository at this point in the history
…PILING_EMULATOR was was set only if emcmake was called, and not when emconfigure was used. The intention is that emcmake is just an alias to emconfigure.
  • Loading branch information
juj committed Sep 15, 2015
1 parent cc38a8b commit 8bc65b8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
7 changes: 1 addition & 6 deletions emcmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,5 @@ import os, subprocess, sys
from tools import shared

configure_path = shared.path_from_root('emconfigure')
node_js = shared.NODE_JS
if type(node_js) is list: node_js = ' '.join(node_js)
node_js = node_js.replace('"', '\"')

exit(subprocess.call([shared.PYTHON, configure_path] + \
[sys.argv[1]] + \
['-DCMAKE_CROSSCOMPILING_EMULATOR="' + node_js +'"'] + sys.argv[2:]))
exit(subprocess.call([shared.PYTHON, configure_path] + sys.argv[1:]))
9 changes: 7 additions & 2 deletions emconfigure
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ variables so that emcc etc. are used. Typical usage:
(but you can run any command instead of configure)
'''
elif 'cmake' in sys.argv[1]:
node_js = shared.NODE_JS
if type(node_js) is list: node_js = ' '.join(node_js)
node_js = node_js.replace('"', '\"')
sys.argv = sys.argv[:2] + ['-DCMAKE_CROSSCOMPILING_EMULATOR="' + node_js +'"'] + sys.argv[2:]

try:
shared.Building.configure(sys.argv[1:])
shared.Building.configure(sys.argv[1:])
except CalledProcessError, e:
sys.exit(e.returncode)
sys.exit(e.returncode)

1 change: 1 addition & 0 deletions tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ def check_makefile(configuration, dirname):
cmd = [emconfigure, 'cmake', '-DCMAKE_BUILD_TYPE=' + configuration, cmake_arguments[i], '-G', generator, cmakelistsdir]
env = os.environ.copy()

print str(cmd)
ret = Popen(cmd, stdout=None if EM_BUILD_VERBOSE_LEVEL >= 2 else PIPE, stderr=None if EM_BUILD_VERBOSE_LEVEL >= 1 else PIPE, env=env).communicate()
if len(ret) > 1 and ret[1] != None and len(ret[1].strip()) > 0:
logging.error(ret[1]) # If there were any errors, print them directly to console for diagnostics.
Expand Down

0 comments on commit 8bc65b8

Please sign in to comment.