Skip to content

Commit 174dca8

Browse files
authored
[emcc.py] Minor refactor in compile_source_file. NFC (#24881)
1 parent 56eae66 commit 174dca8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

emcc.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,13 +688,14 @@ def get_object_filename(input_file):
688688
def compile_source_file(input_file):
689689
logger.debug(f'compiling source file: {input_file}')
690690
output_file = get_object_filename(input_file)
691-
if get_file_suffix(input_file) in ASSEMBLY_EXTENSIONS:
691+
ext = get_file_suffix(input_file)
692+
if ext in ASSEMBLY_EXTENSIONS:
692693
cmd = get_clang_command_asm()
693-
elif get_file_suffix(input_file) in PREPROCESSED_EXTENSIONS:
694+
elif ext in PREPROCESSED_EXTENSIONS:
694695
cmd = get_clang_command_preprocessed()
695696
else:
696697
cmd = get_clang_command()
697-
if get_file_suffix(input_file) in ['.pcm']:
698+
if ext == '.pcm':
698699
cmd = [c for c in cmd if not c.startswith('-fprebuilt-module-path=')]
699700
cmd += compile_args + ['-c', input_file, '-o', output_file]
700701
if options.requested_debug == '-gsplit-dwarf':

0 commit comments

Comments
 (0)