Skip to content

Commit 1668690

Browse files
authored
[emcc.py] Avoid duplication of clang flags list. NFC (emscripten-core#23322)
1 parent 51587b1 commit 1668690

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

emcc.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@
8888
'--proxy-to-worker', '--shell-file', '--source-map-base',
8989
'--threadprofiler', '--use-preload-plugins'
9090
}
91+
CLANG_FLAGS_WITH_ARGS = {
92+
'-MT', '-MF', '-MJ', '-MQ', '-D', '-U', '-o', '-x',
93+
'-Xpreprocessor', '-include', '-imacros', '-idirafter',
94+
'-iprefix', '-iwithprefix', '-iwithprefixbefore',
95+
'-isysroot', '-imultilib', '-A', '-isystem', '-iquote',
96+
'-install_name', '-compatibility_version', '-mllvm',
97+
'-current_version', '-I', '-L', '-include-pch',
98+
'-undefined', '-target', '-Xlinker', '-Xclang', '-z'
99+
}
91100

92101

93102
@unique
@@ -218,13 +227,7 @@ def make_relative(filename):
218227
if ignore:
219228
continue
220229

221-
if arg in ('-MT', '-MF', '-MJ', '-MQ', '-D', '-U', '-o', '-x',
222-
'-Xpreprocessor', '-include', '-imacros', '-idirafter',
223-
'-iprefix', '-iwithprefix', '-iwithprefixbefore',
224-
'-isysroot', '-imultilib', '-A', '-isystem', '-iquote',
225-
'-install_name', '-compatibility_version',
226-
'-current_version', '-I', '-L', '-include-pch',
227-
'-Xlinker', '-Xclang'):
230+
if arg in CLANG_FLAGS_WITH_ARGS:
228231
ignore_next = True
229232

230233
if arg == '-o':
@@ -765,14 +768,7 @@ def phase_setup(options, state, newargs):
765768
continue
766769

767770
arg = newargs[i]
768-
if arg in {'-MT', '-MF', '-MJ', '-MQ', '-D', '-U', '-o', '-x',
769-
'-Xpreprocessor', '-include', '-imacros', '-idirafter',
770-
'-iprefix', '-iwithprefix', '-iwithprefixbefore',
771-
'-isysroot', '-imultilib', '-A', '-isystem', '-iquote',
772-
'-install_name', '-compatibility_version',
773-
'-current_version', '-I', '-L', '-include-pch',
774-
'-undefined', '-target',
775-
'-Xlinker', '-Xclang', '-z'}:
771+
if arg in CLANG_FLAGS_WITH_ARGS:
776772
skip = True
777773

778774
if not arg.startswith('-'):

0 commit comments

Comments
 (0)