allow --clear-cache and --clear-ports in the same command

This commit is contained in:
Alon Zakai 2014-10-21 11:21:22 -07:00
Родитель 6db79ca041
Коммит 1d881c7d93
2 изменённых файлов: 8 добавлений и 3 удалений

9
emcc
Просмотреть файл

@ -456,6 +456,8 @@ try:
raise Exception(err_msg)
return level
should_exit = False
for i in range(len(newargs)):
newargs[i] = newargs[i].strip() # On Windows Vista (and possibly others), excessive spaces in the command line leak into the items in this array, so trim e.g. 'foo.cpp ' -> 'foo.cpp'
if newargs[i].startswith('-O'):
@ -626,11 +628,11 @@ try:
logging.warning('clearing cache')
shared.Cache.erase()
shared.check_sanity(force=True) # this is a good time for a sanity check
sys.exit(0)
should_exit = True
elif newargs[i] == '--clear-ports':
logging.warning('clearing ports')
system_libs.Ports.erase()
sys.exit(0)
should_exit = True
elif newargs[i] == '--save-bc':
check_bad_eq(newargs[i])
save_bc = newargs[i+1]
@ -663,6 +665,9 @@ try:
default_object_extension = '.' + default_object_extension
newargs[i+1] = ''
if should_exit:
sys.exit(0)
newargs = [arg for arg in newargs if arg is not '']
# If user did not specify a default -std for C++ code, specify the emscripten default.

Просмотреть файл

@ -695,7 +695,7 @@ def get_ports(settings):
ok = True
finally:
if not ok:
logging.error('a problem occurred when using an emscripten-ports library. try to run emcc --clear-cache , emcc --clear-ports , and then run this command again')
logging.error('a problem occurred when using an emscripten-ports library. try to run emcc --clear-cache --clear-ports and then run this command again')
return ret