mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 16:56:04 +02:00
Fix for 87407: Scanner Discovery doesn't work if an encountered path contains spaces.
This commit is contained in:
parent
5507b484dd
commit
346e8f27c9
2 changed files with 12 additions and 4 deletions
|
@ -101,7 +101,7 @@ public class CCommandDSC {
|
||||||
* Returns a command where -imacros and -include options have been removed
|
* Returns a command where -imacros and -include options have been removed
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getSCDRunnableCommand() {
|
public String getSCDRunnableCommand(boolean quoteIncludePaths) {
|
||||||
String commandAsString = new String();
|
String commandAsString = new String();
|
||||||
for (Iterator i = compilerCommand.iterator(); i.hasNext(); ) {
|
for (Iterator i = compilerCommand.iterator(); i.hasNext(); ) {
|
||||||
KVStringPair optionPair = (KVStringPair)i.next();
|
KVStringPair optionPair = (KVStringPair)i.next();
|
||||||
|
@ -113,8 +113,16 @@ public class CCommandDSC {
|
||||||
if (optionPair.getKey().equals(SCDOptionsEnum.IMACROS_FILE.toString()) ||
|
if (optionPair.getKey().equals(SCDOptionsEnum.IMACROS_FILE.toString()) ||
|
||||||
optionPair.getKey().equals(SCDOptionsEnum.INCLUDE_FILE.toString()))
|
optionPair.getKey().equals(SCDOptionsEnum.INCLUDE_FILE.toString()))
|
||||||
continue;
|
continue;
|
||||||
commandAsString += optionPair.getKey() + SINGLE_SPACE +
|
if (quoteIncludePaths) {
|
||||||
optionPair.getValue() + SINGLE_SPACE;
|
if (optionPair.getKey().equals(SCDOptionsEnum.INCLUDE.toString())) {
|
||||||
|
commandAsString += optionPair.getKey() + SINGLE_SPACE +
|
||||||
|
"\"" + optionPair.getValue() + "\"" + SINGLE_SPACE; //$NON-NLS-1$//$NON-NLS-2$
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
commandAsString += optionPair.getKey() + SINGLE_SPACE +
|
||||||
|
optionPair.getValue() + SINGLE_SPACE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return commandAsString.trim();
|
return commandAsString.trim();
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class SCDMakefileGenerator extends DefaultRunSIProvider {
|
||||||
buffer.append(':');
|
buffer.append(':');
|
||||||
buffer.append(ENDL);
|
buffer.append(ENDL);
|
||||||
buffer.append("\t@echo begin generating scanner info for $@"+ENDL+"\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
buffer.append("\t@echo begin generating scanner info for $@"+ENDL+"\t"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
buffer.append(cmd.getSCDRunnableCommand());
|
buffer.append(cmd.getSCDRunnableCommand(true)); // quoteIncludePaths
|
||||||
buffer.append(" -E -P -v -dD "); //$NON-NLS-1$
|
buffer.append(" -E -P -v -dD "); //$NON-NLS-1$
|
||||||
buffer.append(cmd.appliesToCPPFileType() ? "specs.cpp" : "specs.c"); //$NON-NLS-1$ //$NON-NLS-2$
|
buffer.append(cmd.appliesToCPPFileType() ? "specs.cpp" : "specs.c"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
buffer.append(ENDL);
|
buffer.append(ENDL);
|
||||||
|
|
Loading…
Add table
Reference in a new issue