Hi,
I've added a preferences page where the user can change the default CDialect compiler option for the project creation.
I change nothing, I create a project A, the CDialect option has no value (empty combo under the C/C++ settings).
I change my pref for ex ISO C11 (-std=c11), I create a project B, the CDialect option has the new value (the combo has the C11 value selected)
Good but ... when I open again the project A, the option has changed :(
Here is my code:
// force CDialect compiler options with preferences put
ITool[] tool = config.getTools();
for(ITool o:tool){
IOption[] opt = o.getOptions();
for(IOption ot:opt){
if(isCDialectCProjectMustBeChanged){
if(ot.getBaseId().equals("gnu.c.compiler.option.dialect.std")){
// i tried 1st but not good
//ot.setValue(newValue);
// I tried but same result
ManagedBuildManager.setOption(config, o, ot, newValue);
}
}
}
}
Any idea ?
Thank you
Chris
[Updated on: Thu, 01 June 2017 05:17] by Moderator