Hi Jonah,
Thanks for the answer.
I have better grasp the problem. I provide you in attached file a plugin to easily reproduce the behavior because there is some aspect that requires custom config.
Actually, the problem is how to define the option under the toolchain element in the extension point org.eclipse.cdt.managedbuilder.core.buildDefinitions.
If you define an option (& the associated optionCategory) directly under the toolchain element and not under a tool element, an inheritance problem can appears.
My plugin allows you to create a project with my own toolchain.
Please follow these steps to reproduce the problem:
1) Create a new C project, select "Others -> Example Executable" in project type panel. Then click on finish.
2) Open the property "C/C++ Build" -> "Settings" of the project
Change the "General" option value to "non persistant value 2"
and Apply the changes.
3) Click on "Compiler" and check that the option "All options" should be equals to "-mnonPersistent-opt=value2"
Close the properties
4) Create a folder inside the project
Right click on this folder and open the properties "C/C++ Build" -> "Settings".
First point the "General" option is no longer visible in the left panel but the "non persistent value" option is still "value2" in "All options"
5) Click on "Optimization" in the left panel and tick the checkbox "useless option" ;-)
Apply the changes, close the property and close the project.
6) Re-open the project, re-open the properties for the folder and not for the project!
the option "all options" has changed!!! --> "-mnonPersistent-opt=value1"
But if you check the same option via the project properties then the value is "value2".
Because of during the parsing of the xml cproject, it can not retrieve the option "non persistent option" and so applies the default value defined in the extension point that is "value1".
Note that:
- if the valueType of the option is something other than enumerated value then the option just disappearing in "all option"
- I would prefer not to define this option under compiler tool because this option is used by several tools.
- In my plugin.xml, there is an other commented option defined this time under compiler tool (if you want to test the difference)
Regards,
Florent