summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2018-07-04 17:03:29 -0400
committerJeff Johnston2018-07-04 17:03:29 -0400
commita5ed8ea2a4631882321b04e72afa95e6896fcf3e (patch)
treea1ca89cfaa55a61d31f0ee36f69d52bbf5f1091e
parent33e15fae72d11b34bc148fb06dd0271b7878648b (diff)
downloadorg.eclipse.cdt-a5ed8ea2a4631882321b04e72afa95e6896fcf3e.tar.gz
org.eclipse.cdt-a5ed8ea2a4631882321b04e72afa95e6896fcf3e.tar.xz
org.eclipse.cdt-a5ed8ea2a4631882321b04e72afa95e6896fcf3e.zip
Bug 536363 - Meson project include paths wrong when using ccache
- fix GCCToolChain and ContainerGCCToolChain to not blindly take the first token in the command string when processing scannerinfo; if it is "ccache", take the second token instead Change-Id: I4b2b7dfaccae6f3ec968bbe4217c57994ad71963
-rw-r--r--build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java11
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java12
2 files changed, 19 insertions, 4 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 fb521623da..ff39a61a99 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())) {
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java
index 9d6524e43e..9fce12031f 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java
@@ -186,7 +186,14 @@ public class ContainerGCCToolChain extends PlatformObject
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());
@@ -213,7 +220,8 @@ public class ContainerGCCToolChain extends PlatformObject
}
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())) {