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

Patch for Sean Evoy:

Details in ChangeLog.
This commit is contained in:
Doug Schaefer 2003-10-02 02:56:46 +00:00
parent cc6084024d
commit 0e11088e84
3 changed files with 66 additions and 1 deletions

View file

@ -1,3 +1,18 @@
2003-10-01 Sean Evoy
Final fix for bugs 44020.
The problem lay with the way that new projects were being created when the
root configuration of the project had tool references overriding options.
What the new configuration should have been doing is making a personal copy
of the tool reference and its options. Instead, they were all sharing the
parents. Seems simple enough now that I found it.
OptionReference provides a method to retreive its option (so new
OptionReferences can be cloned).
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
Configuration now behaves correctly when it is created from another configuration.
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
2003-10-01 Sean Evoy 2003-10-01 Sean Evoy
Fix for bugs 43490 (trivial), 44020, and 43980. Fix for bugs 43490 (trivial), 44020, and 43980.
Added a new field to the schema for a tool. The attribute manages a list of Added a new field to the schema for a tool. The attribute manages a list of

View file

@ -66,8 +66,54 @@ public class Configuration extends BuildObject implements IConfiguration {
this.target = target; this.target = target;
this.parent = parent; this.parent = parent;
// Check that the tool and the project match
IProject project = (IProject) target.getOwner();
// Get the tool references from the parent // Get the tool references from the parent
getLocalToolReferences().addAll(((Configuration)parent).getLocalToolReferences()); List parentToolRefs = ((Configuration)parent).getLocalToolReferences();
Iterator iter = parentToolRefs.listIterator();
while (iter.hasNext()) {
ToolReference toolRef = (ToolReference)iter.next();
// Make a new ToolReference based on the tool in the ref
ToolReference newRef = new ToolReference(this, toolRef.getTool());
List optRefs = toolRef.getLocalOptionRefs();
Iterator optIter = optRefs.listIterator();
while (optIter.hasNext()) {
OptionReference optRef = (OptionReference)optIter.next();
IOption opt = optRef.getOption();
try {
switch (opt.getValueType()) {
case IOption.BOOLEAN:
new OptionReference(newRef, opt).setValue(optRef.getBooleanValue());
break;
case IOption.STRING:
new OptionReference(newRef, opt).setValue(optRef.getStringValue());
break;
case IOption.ENUMERATED:
new OptionReference(newRef, opt).setValue(optRef.getSelectedEnum());
break;
case IOption.STRING_LIST :
new OptionReference(newRef, opt).setValue(optRef.getStringListValue());
break;
case IOption.INCLUDE_PATH :
new OptionReference(newRef, opt).setValue(optRef.getIncludePaths());
break;
case IOption.PREPROCESSOR_SYMBOLS :
new OptionReference(newRef, opt).setValue(optRef.getDefinedSymbols());
break;
case IOption.LIBRARIES :
new OptionReference(newRef, opt).setValue(optRef.getLibraries());
break;
case IOption.OBJECTS :
new OptionReference(newRef, opt).setValue(optRef.getUserObjects());
break;
}
} catch (BuildException e) {
continue;
}
}
}
target.addConfiguration(this); target.addConfiguration(this);
} }

View file

@ -319,6 +319,10 @@ public class OptionReference implements IOption {
(String[])builtIns.toArray(new String[builtIns.size()]); (String[])builtIns.toArray(new String[builtIns.size()]);
} }
public IOption getOption() {
return option;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IOption#getDefaultEnumValue() * @see org.eclipse.cdt.core.build.managed.IOption#getDefaultEnumValue()
*/ */