mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
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
(cherry picked from commit a5ed8ea2a4
)
This commit is contained in:
parent
a1ed9cdb39
commit
ee5f57d536
2 changed files with 19 additions and 4 deletions
|
@ -256,7 +256,14 @@ public class GCCToolChain extends PlatformObject implements IToolChain {
|
||||||
try {
|
try {
|
||||||
Path buildDirectory = Paths.get(buildDirectoryURI);
|
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<>();
|
List<String> commandLine = new ArrayList<>();
|
||||||
if (command.isAbsolute()) {
|
if (command.isAbsolute()) {
|
||||||
commandLine.add(command.toString());
|
commandLine.add(command.toString());
|
||||||
|
@ -283,7 +290,7 @@ public class GCCToolChain extends PlatformObject implements IToolChain {
|
||||||
}
|
}
|
||||||
|
|
||||||
addDiscoveryOptions(commandLine);
|
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
|
// Strip surrounding quotes from the args on Windows
|
||||||
if (Platform.OS_WIN32.equals(Platform.getOS())) {
|
if (Platform.OS_WIN32.equals(Platform.getOS())) {
|
||||||
|
|
|
@ -186,7 +186,14 @@ public class ContainerGCCToolChain extends PlatformObject
|
||||||
try {
|
try {
|
||||||
Path buildDirectory = Paths.get(buildDirectoryURI);
|
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<>();
|
List<String> commandLine = new ArrayList<>();
|
||||||
if (command.isAbsolute()) {
|
if (command.isAbsolute()) {
|
||||||
commandLine.add(command.toString());
|
commandLine.add(command.toString());
|
||||||
|
@ -213,7 +220,8 @@ public class ContainerGCCToolChain extends PlatformObject
|
||||||
}
|
}
|
||||||
|
|
||||||
addDiscoveryOptions(commandLine);
|
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
|
// Strip surrounding quotes from the args on Windows
|
||||||
if (Platform.OS_WIN32.equals(Platform.getOS())) {
|
if (Platform.OS_WIN32.equals(Platform.getOS())) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue