mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 06:32:10 +02:00
bug 275462: Build failed due to dependency files with spaces
Patch from Dmitry Kozlov
This commit is contained in:
parent
9ab6b2b9f1
commit
e918fcfd0c
1 changed files with 10 additions and 5 deletions
|
@ -166,18 +166,23 @@ public class DefaultGCCDependencyCalculator2Commands implements
|
|||
// -MP
|
||||
options[1] = "-MP"; //$NON-NLS-1$
|
||||
// -MF$(@:%.o=%.d)
|
||||
options[2] = "-MF\"$(@:%.o=%.d)\""; //$NON-NLS-1$
|
||||
//options[2] = "-MF\"${OutputDirRelPath}${OutputFileBaseName}.d\""; //$NON-NLS-1$
|
||||
// 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$
|
||||
}
|
||||
if( buildContext instanceof IResourceConfiguration || needExplicitRuleForFile ) {
|
||||
IPath outPath = getDependencyFiles()[0];
|
||||
// -MT"dependecy-file-name"
|
||||
String optTxt = "-MT\""; //$NON-NLS-1$
|
||||
optTxt += GnuMakefileGenerator.escapeWhitespaces(outPath.toString()) + "\""; //$NON-NLS-1$
|
||||
String optTxt = "-MT\"" + outPath.toString() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
options[3] = optTxt;
|
||||
} else {
|
||||
// -MT"$(@:%.o=%.d) %.o"
|
||||
options[3] = "-MT\"$(@:%.o=%.d)\""; //$NON-NLS-1$
|
||||
//options[3] = "-MT\"${OutputDirRelPath}${OutputFileBaseName}.d\""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return options;
|
||||
|
|
Loading…
Add table
Reference in a new issue