1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

bug 275462: Build failed due to dependency files with spaces

Patch from Dmitry Kozlov
This commit is contained in:
Andrew Gvozdev 2009-09-24 02:00:23 +00:00
parent 9ab6b2b9f1
commit e918fcfd0c

View file

@ -166,18 +166,23 @@ public class DefaultGCCDependencyCalculator2Commands implements
// -MP // -MP
options[1] = "-MP"; //$NON-NLS-1$ options[1] = "-MP"; //$NON-NLS-1$
// -MF$(@:%.o=%.d) // -MF$(@:%.o=%.d)
// Due to bug in GNU make $(@:%.o=%.d) applied to "/buggy path_with_3_spaces/f.o"
// becomes "/buggy path_with_3_spaces/f.d". To avoid this we have to insert
// filename explicitly instead of substitution rule
if ( needExplicitRuleForFile ) {
IPath outPath = getDependencyFiles()[0];
options[2] = "-MF\"" + outPath.toString() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
} else {
options[2] = "-MF\"$(@:%.o=%.d)\""; //$NON-NLS-1$ options[2] = "-MF\"$(@:%.o=%.d)\""; //$NON-NLS-1$
//options[2] = "-MF\"${OutputDirRelPath}${OutputFileBaseName}.d\""; //$NON-NLS-1$ }
if( buildContext instanceof IResourceConfiguration || needExplicitRuleForFile ) { if( buildContext instanceof IResourceConfiguration || needExplicitRuleForFile ) {
IPath outPath = getDependencyFiles()[0]; IPath outPath = getDependencyFiles()[0];
// -MT"dependecy-file-name" // -MT"dependecy-file-name"
String optTxt = "-MT\""; //$NON-NLS-1$ String optTxt = "-MT\"" + outPath.toString() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
optTxt += GnuMakefileGenerator.escapeWhitespaces(outPath.toString()) + "\""; //$NON-NLS-1$
options[3] = optTxt; options[3] = optTxt;
} else { } else {
// -MT"$(@:%.o=%.d) %.o" // -MT"$(@:%.o=%.d) %.o"
options[3] = "-MT\"$(@:%.o=%.d)\""; //$NON-NLS-1$ options[3] = "-MT\"$(@:%.o=%.d)\""; //$NON-NLS-1$
//options[3] = "-MT\"${OutputDirRelPath}${OutputFileBaseName}.d\""; //$NON-NLS-1$
} }
return options; return options;