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:
parent
6ac0c5c7eb
commit
f31b6c334c
3 changed files with 18 additions and 12 deletions
|
@ -579,10 +579,12 @@ public class MbsMacroSupplier implements IBuildMacroSupplier {
|
||||||
private IPath getOutputFilePath(IPath inputPath, IConfiguration cfg){
|
private IPath getOutputFilePath(IPath inputPath, IConfiguration cfg){
|
||||||
ITool buildTools[] = null;
|
ITool buildTools[] = null;
|
||||||
IResourceConfiguration rcCfg = cfg.getResourceConfiguration(inputPath.toString());
|
IResourceConfiguration rcCfg = cfg.getResourceConfiguration(inputPath.toString());
|
||||||
if(rcCfg != null)
|
if(rcCfg != null) {
|
||||||
buildTools = rcCfg.getToolsToInvoke();
|
buildTools = rcCfg.getToolsToInvoke();
|
||||||
else
|
}
|
||||||
|
if (buildTools == null || buildTools.length == 0) {
|
||||||
buildTools = cfg.getFilteredTools();
|
buildTools = cfg.getFilteredTools();
|
||||||
|
}
|
||||||
|
|
||||||
String name = null;
|
String name = null;
|
||||||
IPath path = null;
|
IPath path = null;
|
||||||
|
|
|
@ -113,9 +113,10 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
|
||||||
String outflag = ""; //$NON-NLS-1$
|
String outflag = ""; //$NON-NLS-1$
|
||||||
String outputPrefix = ""; //$NON-NLS-1$
|
String outputPrefix = ""; //$NON-NLS-1$
|
||||||
String outputFile = ""; //$NON-NLS-1$
|
String outputFile = ""; //$NON-NLS-1$
|
||||||
if( resConfig != null) {
|
ITool[] tools;
|
||||||
ITool[] tools = resConfig.getToolsToInvoke();
|
if( resConfig != null && (tools = resConfig.getToolsToInvoke()) != null && tools.length > 0) {
|
||||||
String cmd = tools[0].getToolCommand();
|
ITool tool = tools[0];
|
||||||
|
String cmd = tool.getToolCommand();
|
||||||
//try to resolve the build macros in the tool command
|
//try to resolve the build macros in the tool command
|
||||||
try{
|
try{
|
||||||
String resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(cmd,
|
String resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(cmd,
|
||||||
|
@ -131,7 +132,7 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
|
||||||
|
|
||||||
String[] toolFlags = null;
|
String[] toolFlags = null;
|
||||||
try {
|
try {
|
||||||
toolFlags = tools[0].getToolCommandFlags(resource.getLocation(),null);
|
toolFlags = tool.getToolCommandFlags(resource.getLocation(),null);
|
||||||
} catch( BuildException ex ) {
|
} catch( BuildException ex ) {
|
||||||
// TODO add some routines to catch this
|
// TODO add some routines to catch this
|
||||||
toolFlags = EMPTY_STRING_ARRAY;
|
toolFlags = EMPTY_STRING_ARRAY;
|
||||||
|
@ -144,9 +145,9 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
|
||||||
for (int i=0; i<toolFlags.length; i++) {
|
for (int i=0; i<toolFlags.length; i++) {
|
||||||
flags[4+i] = toolFlags[i];
|
flags[4+i] = toolFlags[i];
|
||||||
}
|
}
|
||||||
IManagedCommandLineGenerator cmdLGen = tools[0].getCommandLineGenerator();
|
IManagedCommandLineGenerator cmdLGen = tool.getCommandLineGenerator();
|
||||||
cmdLInfo = cmdLGen.generateCommandLineInfo( tools[0], cmd, flags, outflag, outputPrefix,
|
cmdLInfo = cmdLGen.generateCommandLineInfo( tool, cmd, flags, outflag, outputPrefix,
|
||||||
outputFile, inputs, tools[0].getCommandLinePattern() );
|
outputFile, inputs, tool.getCommandLinePattern() );
|
||||||
buildCmd = cmdLInfo.getCommandLine();
|
buildCmd = cmdLInfo.getCommandLine();
|
||||||
} else {
|
} else {
|
||||||
String cmd = info.getToolForSource(inputExtension);
|
String cmd = info.getToolForSource(inputExtension);
|
||||||
|
|
|
@ -2014,11 +2014,14 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
String inputExtension = sourceLocation.getFileExtension();
|
String inputExtension = sourceLocation.getFileExtension();
|
||||||
String outputExtension = info.getOutputExtension(inputExtension);
|
String outputExtension = info.getOutputExtension(inputExtension);
|
||||||
|
|
||||||
ITool tool;
|
ITool tool = null;
|
||||||
if( resConfig != null) {
|
if( resConfig != null) {
|
||||||
ITool[] tools = resConfig.getToolsToInvoke();
|
ITool[] tools = resConfig.getToolsToInvoke();
|
||||||
|
if (tools != null && tools.length > 0) {
|
||||||
tool = tools[0];
|
tool = tools[0];
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
|
if (tool == null) {
|
||||||
tool = info.getToolFromInputExtension(inputExtension);
|
tool = info.getToolFromInputExtension(inputExtension);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue