still support -Wno-warn-absolute-paths #3833

This commit is contained in:
Alon Zakai 2015-10-26 10:19:43 -07:00
Родитель 15d592f78c
Коммит 426b7299e3
2 изменённых файлов: 13 добавлений и 3 удалений

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

@ -446,8 +446,11 @@ try:
if newargs[i] == '-Wwarn-absolute-paths':
newargs[i] = ''
absolute_warning_shown = False
# Scan for individual -l/-L/-I arguments and concatenate the next arg on if there is no suffix
if newargs[i] in ['-l', '-L', '-I']:
elif newargs[i] == '-Wno-warn-absolute-paths':
newargs[i] = ''
absolute_warning_shown = True
elif newargs[i] in ['-l', '-L', '-I']:
# Scan for individual -l/-L/-I arguments and concatenate the next arg on if there is no suffix
newargs[i] += newargs[i+1]
newargs[i+1] = ''

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

@ -1040,11 +1040,18 @@ int f() {
(['-L/usr/something', '-Wwarn-absolute-paths'], True),
(['-I/usr/something'], False),
(['-L/usr/something'], False),
(['-I/usr/something', '-Wno-warn-absolute-paths'], False),
(['-L/usr/something', '-Wno-warn-absolute-paths'], False),
(['-Isubdir/something', '-Wwarn-absolute-paths'], False),
(['-Lsubdir/something', '-Wwarn-absolute-paths'], False),
([], False)]:
err = Popen([PYTHON, EMCC, 'main.c'] + args, stderr=PIPE).communicate()[1]
print args, expected
proc = Popen([PYTHON, EMCC, 'main.c'] + args, stderr=PIPE)
err = proc.communicate()[1]
assert proc.returncode is 0
assert ('encountered. If this is to a local system header/library, it may cause problems (local system files make sense for compiling natively on your system, but not necessarily to JavaScript)' in err) == expected, err
if not expected:
assert err == '', err
def test_local_link(self):
# Linking a local library directly, like /usr/lib/libsomething.so, cannot work of course since it