Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,6 @@ def run(args):
print(f'libraries: ={cache.get_lib_dir(absolute=True)}')
return 0

if '-print-resource-dir' in args:
shared.check_call([clang] + args)
return 0

if '-print-libgcc-file-name' in args or '--print-libgcc-file-name' in args:
settings.limit_settings(None)
compiler_rt = system_libs.Library.get_usable_variations()['libcompiler_rt']
Expand Down Expand Up @@ -292,6 +288,10 @@ def run(args):

phase_setup(options, state)

if '-print-resource-dir' in args or any(a.startswith('--print-prog-name') for a in args):
shared.exec_process([clang] + compile.get_cflags(tuple(args)) + args)
assert False, 'exec_process should not return'

if '--cflags' in args:
# Just print the flags we pass to clang and exit. We need to do this after
# phase_setup because the setup sets things like SUPPORT_LONGJMP.
Expand Down Expand Up @@ -513,7 +513,7 @@ def get_clang_command_asm():
else:
cmd = get_clang_command() + newargs
shared.exec_process(cmd)
assert False, 'exec_process does not return'
assert False, 'exec_process should not return'

# In COMPILE_AND_LINK we need to compile source files too, but we also need to
# filter out the link flags
Expand Down
8 changes: 8 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,14 @@ def test_print_resource_dir(self):
llvm_root = os.path.normcase(os.path.dirname(config.LLVM_ROOT))
self.assertContained(llvm_root, resource_dir)

@crossplatform
def test_print_prog_name(self):
output = self.run_process([EMCC, '--print-prog-name=clang'], stdout=PIPE).stdout
expected = CLANG_CC
if WINDOWS:
expected = os.path.normpath(shared.unsuffixed(CLANG_CC))
self.assertContained(expected, output)

@crossplatform
@parameterized({
'': [[]],
Expand Down