Skip to content

Commit 46ffd1f

Browse files
authored
Merge pull request hedronvision#125 from manshengyang/main
Support ccache
2 parents bdd68da + c43d082 commit 46ffd1f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

refresh.template.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,15 @@ def _all_platform_patch(compile_args: typing.List[str]):
798798
new_compile_args.append(arg)
799799
compile_args = new_compile_args
800800

801+
# Discover compilers that are actually symlinks to ccache--and replace them with the underlying compiler
802+
if os.path.islink(compile_args[0]):
803+
compiler_path = os.readlink(compile_args[0])
804+
if os.path.basename(compiler_path) == "ccache":
805+
compiler = os.path.basename(compile_args[0])
806+
real_compiler_path = shutil.which(compiler)
807+
if real_compiler_path:
808+
compile_args[0] = real_compiler_path
809+
801810
# Any other general fixes would go here...
802811

803812
return compile_args

0 commit comments

Comments
 (0)