fix -s bug with a new -compiler param starting on the next arg

This commit is contained in:
Alon Zakai 2015-10-19 10:43:19 -07:00
Родитель 5d89a5daec
Коммит 12706b0bd3
2 изменённых файлов: 6 добавлений и 1 удалений

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

@ -164,7 +164,7 @@ elif '-dumpmachine' in sys.argv:
def is_minus_s_for_emcc(newargs, i):
assert newargs[i] == '-s'
if i+1 < len(newargs) and '=' in newargs[i+1]: # -s OPT=VALUE is for us, -s by itself is a linker option
if i+1 < len(newargs) and '=' in newargs[i+1] and not newargs[i+1].startswith('-'): # -s OPT=VALUE is for us, -s by itself is a linker option
return True
else:
logging.warning('treating -s as linker option and not as -s OPT=VALUE for js compilation')

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

@ -5690,3 +5690,8 @@ int main() {
process = Popen([PYTHON, EMCC] + '-l m -l c -I'.split() + [path_from_root('tests', 'include_test'), path_from_root('tests', 'lib_include_flags.c')], stdout=PIPE, stderr=PIPE)
process.communicate()
assert process.returncode is 0, 'Empty -l/-L/-I flags should read the next arg as a param'
def test_dash_s(self):
print check_execute([PYTHON, EMCC, path_from_root('tests', 'hello_world.cpp'), '-s', '-std=c++03'])
self.assertContained('hello, world!', run_js('a.out.js'))