1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fix for 87407: Scanner Discovery doesn't work if an encountered path contains spaces.

This commit is contained in:
Vladimir Hirsl 2005-07-15 19:30:33 +00:00
parent 5507b484dd
commit 346e8f27c9
2 changed files with 12 additions and 4 deletions

View file

@ -101,7 +101,7 @@ public class CCommandDSC {
* Returns a command where -imacros and -include options have been removed
* @return
*/
public String getSCDRunnableCommand() {
public String getSCDRunnableCommand(boolean quoteIncludePaths) {
String commandAsString = new String();
for (Iterator i = compilerCommand.iterator(); i.hasNext(); ) {
KVStringPair optionPair = (KVStringPair)i.next();
@ -113,8 +113,16 @@ public class CCommandDSC {
if (optionPair.getKey().equals(SCDOptionsEnum.IMACROS_FILE.toString()) ||
optionPair.getKey().equals(SCDOptionsEnum.INCLUDE_FILE.toString()))
continue;
commandAsString += optionPair.getKey() + SINGLE_SPACE +
optionPair.getValue() + SINGLE_SPACE;
if (quoteIncludePaths) {
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();

View file

@ -84,7 +84,7 @@ public class SCDMakefileGenerator extends DefaultRunSIProvider {
buffer.append(':');
buffer.append(ENDL);
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(cmd.appliesToCPPFileType() ? "specs.cpp" : "specs.c"); //$NON-NLS-1$ //$NON-NLS-2$
buffer.append(ENDL);