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

Fix problem with resource configurations

This commit is contained in:
Leo Treggiari 2005-09-16 23:25:37 +00:00
parent 6ac0c5c7eb
commit f31b6c334c
3 changed files with 18 additions and 12 deletions

View file

@ -579,10 +579,12 @@ public class MbsMacroSupplier implements IBuildMacroSupplier {
private IPath getOutputFilePath(IPath inputPath, IConfiguration cfg){
ITool buildTools[] = null;
IResourceConfiguration rcCfg = cfg.getResourceConfiguration(inputPath.toString());
if(rcCfg != null)
if(rcCfg != null) {
buildTools = rcCfg.getToolsToInvoke();
else
}
if (buildTools == null || buildTools.length == 0) {
buildTools = cfg.getFilteredTools();
}
String name = null;
IPath path = null;

View file

@ -113,9 +113,10 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
String outflag = ""; //$NON-NLS-1$
String outputPrefix = ""; //$NON-NLS-1$
String outputFile = ""; //$NON-NLS-1$
if( resConfig != null) {
ITool[] tools = resConfig.getToolsToInvoke();
String cmd = tools[0].getToolCommand();
ITool[] tools;
if( resConfig != null && (tools = resConfig.getToolsToInvoke()) != null && tools.length > 0) {
ITool tool = tools[0];
String cmd = tool.getToolCommand();
//try to resolve the build macros in the tool command
try{
String resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(cmd,
@ -131,7 +132,7 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
String[] toolFlags = null;
try {
toolFlags = tools[0].getToolCommandFlags(resource.getLocation(),null);
toolFlags = tool.getToolCommandFlags(resource.getLocation(),null);
} catch( BuildException ex ) {
// TODO add some routines to catch this
toolFlags = EMPTY_STRING_ARRAY;
@ -144,9 +145,9 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
for (int i=0; i<toolFlags.length; i++) {
flags[4+i] = toolFlags[i];
}
IManagedCommandLineGenerator cmdLGen = tools[0].getCommandLineGenerator();
cmdLInfo = cmdLGen.generateCommandLineInfo( tools[0], cmd, flags, outflag, outputPrefix,
outputFile, inputs, tools[0].getCommandLinePattern() );
IManagedCommandLineGenerator cmdLGen = tool.getCommandLineGenerator();
cmdLInfo = cmdLGen.generateCommandLineInfo( tool, cmd, flags, outflag, outputPrefix,
outputFile, inputs, tool.getCommandLinePattern() );
buildCmd = cmdLInfo.getCommandLine();
} else {
String cmd = info.getToolForSource(inputExtension);

View file

@ -2014,11 +2014,14 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
String inputExtension = sourceLocation.getFileExtension();
String outputExtension = info.getOutputExtension(inputExtension);
ITool tool;
ITool tool = null;
if( resConfig != null) {
ITool[] tools = resConfig.getToolsToInvoke();
tool = tools[0];
} else {
if (tools != null && tools.length > 0) {
tool = tools[0];
}
}
if (tool == null) {
tool = info.getToolFromInputExtension(inputExtension);
}