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

Fix some minor bugs found by testing

This commit is contained in:
Leo Treggiari 2005-05-12 19:07:32 +00:00
parent 68da70cb9e
commit 297e573e08
3 changed files with 17 additions and 9 deletions

View file

@ -650,9 +650,11 @@ public class OutputType extends BuildObject implements IOutputType {
*/ */
public boolean isOutputExtension(String ext) { public boolean isOutputExtension(String ext) {
String[] exts = getOutputExtensions(); String[] exts = getOutputExtensions();
if (exts != null) {
for (int i=0; i<exts.length; i++) { for (int i=0; i<exts.length; i++) {
if (ext.equals(exts[i])) return true; if (ext.equals(exts[i])) return true;
} }
}
return false; return false;
} }

View file

@ -36,6 +36,7 @@ import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineGenerator;
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator; import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator;
import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Element; import org.w3c.dom.Element;
@ -1575,19 +1576,22 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
List inputs = new ArrayList(); List inputs = new ArrayList();
int optType = option.getValueType(); int optType = option.getValueType();
if (optType == IOption.STRING) { if (optType == IOption.STRING) {
inputs.add(option.getStringValue()); inputs.add(Path.fromOSString(option.getStringValue()));
} else if ( } else if (
optType == IOption.STRING_LIST || optType == IOption.STRING_LIST ||
optType == IOption.LIBRARIES || optType == IOption.LIBRARIES ||
optType == IOption.OBJECTS) { optType == IOption.OBJECTS) {
inputs = (List)option.getValue(); List inputNames = (List)option.getValue();
for (int j=0; j<inputNames.size(); j++) {
inputs.add(Path.fromOSString((String)inputNames.get(j)));
}
} }
allDeps.addAll(inputs); allDeps.addAll(inputs);
} catch( BuildException ex ) { } catch( BuildException ex ) {
} }
} }
} else if (type.getBuildVariable() != null && type.getBuildVariable().length() > 0) { } else if (type.getBuildVariable() != null && type.getBuildVariable().length() > 0) {
allDeps.add("$(" + type.getBuildVariable() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ allDeps.add(Path.fromOSString("$(" + type.getBuildVariable() + ")")); //$NON-NLS-1$ //$NON-NLS-2$
} }
} }
} }
@ -1612,7 +1616,7 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
if (!type.getPrimaryInput()) { if (!type.getPrimaryInput()) {
String var = type.getBuildVariable(); String var = type.getBuildVariable();
if (var != null && var.length() > 0) { if (var != null && var.length() > 0) {
allRes.add("$(" + type.getBuildVariable() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ allRes.add(Path.fromOSString("$(" + type.getBuildVariable() + ")")); //$NON-NLS-1$ //$NON-NLS-2$
} }
} }
} }
@ -1952,10 +1956,12 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
List allExts = new ArrayList(); List allExts = new ArrayList();
for (int i=0; i<types.length; i++) { for (int i=0; i<types.length; i++) {
String[] exts = types[i].getOutputExtensions(); String[] exts = types[i].getOutputExtensions();
if (exts != null) {
for (int j=0; j<exts.length; j++) { for (int j=0; j<exts.length; j++) {
allExts.add(exts[j]); allExts.add(exts[j]);
} }
} }
}
if (allExts.size() > 0) { if (allExts.size() > 0) {
return (String[])allExts.toArray(new String[allExts.size()]); return (String[])allExts.toArray(new String[allExts.size()]);
} }

View file

@ -1845,7 +1845,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
String OptDotExt = ""; //$NON-NLS-1$ String OptDotExt = ""; //$NON-NLS-1$
boolean isItLinked = false; boolean isItLinked = false;
if (outputExtension != "") //$NON-NLS-1$ if (outputExtension != null && outputExtension.length() > 0)
OptDotExt = DOT + outputExtension; OptDotExt = DOT + outputExtension;
IConfiguration config = info.getDefaultConfiguration(); IConfiguration config = info.getDefaultConfiguration();