Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java')
-rw-r--r--build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java
index fb521623dae..ff39a61a99b 100644
--- a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java
+++ b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java
@@ -256,7 +256,14 @@ public class GCCToolChain extends PlatformObject implements IToolChain {
try {
Path buildDirectory = Paths.get(buildDirectoryURI);
- Path command = Paths.get(commandStrings.get(0));
+ int offset = 0;
+ Path command = Paths.get(commandStrings.get(offset));
+
+ // look for ccache being used
+ if (command.toString().contains("ccache")) { //$NON-NLS-1$
+ command = Paths.get(commandStrings.get(++offset));
+ }
+
List<String> commandLine = new ArrayList<>();
if (command.isAbsolute()) {
commandLine.add(command.toString());
@@ -283,7 +290,7 @@ public class GCCToolChain extends PlatformObject implements IToolChain {
}
addDiscoveryOptions(commandLine);
- commandLine.addAll(commandStrings.subList(1, commandStrings.size()));
+ commandLine.addAll(commandStrings.subList(offset + 1, commandStrings.size()));
// Strip surrounding quotes from the args on Windows
if (Platform.OS_WIN32.equals(Platform.getOS())) {

Back to the top