mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Strip off the wrapper script on the command line.
This commit is contained in:
parent
81eedf4bf3
commit
88ba8784c2
1 changed files with 17 additions and 9 deletions
|
@ -66,29 +66,37 @@ public class GCCPerFileBOPConsoleParser extends AbstractGCCBOPConsoleParser {
|
||||||
if (compilerInvocationIndex == -1)
|
if (compilerInvocationIndex == -1)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
// Search for the compiler invocation command
|
||||||
|
|
||||||
// expecting that compiler invocation is the first token in the line
|
// expecting that compiler invocation is the first token in the line
|
||||||
String[] split = line.split("\\s+"); //$NON-NLS-1$
|
String[] split = line.split("\\s+"); //$NON-NLS-1$
|
||||||
int cii2 = -1;
|
boolean found = false;
|
||||||
for (int i = 0; i < 2; ++i) {
|
for (int i = 0; i < split.length; ++i) {
|
||||||
// Checking the first two tokens since the first may be a wrapper script
|
|
||||||
String command = split[i];
|
String command = split[i];
|
||||||
// verify that it is compiler invocation
|
// verify that it is compiler invocation
|
||||||
for (int cii = 0; cii < compilerInvocation.length; ++cii) {
|
for (int cii = 0; cii < compilerInvocation.length; ++cii) {
|
||||||
cii2 = command.indexOf(compilerInvocation[cii]);
|
if (command.indexOf(compilerInvocation[cii]) >= 0) {
|
||||||
if (cii2 != -1)
|
found = true;
|
||||||
break;
|
if (i > 0) {
|
||||||
|
// strip off anything before the compiler command
|
||||||
|
String[] old = split;
|
||||||
|
split = new String[old.length - i];
|
||||||
|
System.arraycopy(old, i, split, 0, split.length);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (cii2 != -1)
|
if (found)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (cii2 == -1) {
|
if (!found) {
|
||||||
TraceUtil.outputTrace("Error identifying compiler command", line, TraceUtil.EOL); //$NON-NLS-1$
|
TraceUtil.outputTrace("Error identifying compiler command", line, TraceUtil.EOL); //$NON-NLS-1$
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// find a file name
|
// find a file name
|
||||||
int extensionsIndex = -1;
|
int extensionsIndex = -1;
|
||||||
boolean found = false;
|
found = false;
|
||||||
String filePath = null;
|
String filePath = null;
|
||||||
for (int i = 1; i < split.length; ++i) {
|
for (int i = 1; i < split.length; ++i) {
|
||||||
int k = split[i].lastIndexOf('.');
|
int k = split[i].lastIndexOf('.');
|
||||||
|
|
Loading…
Add table
Reference in a new issue