Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » [RESOLVED] How change the value of an IOption
[RESOLVED] How change the value of an IOption [message #1764661] Thu, 01 June 2017 08:51 Go to next message
kkt8 Mising name is currently offline kkt8 Mising nameFriend
Messages: 27
Registered: November 2010
Junior Member
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 09:17]

Report message to a moderator

Re: How change the value of an IOption [message #1764664 is a reply to message #1764661] Thu, 01 June 2017 09:16 Go to previous messageGo to next message
kkt8 Mising name is currently offline kkt8 Mising nameFriend
Messages: 27
Registered: November 2010
Junior Member
oups I did a mistake .... it's correct !
sorry for the post
Re: How change the value of an IOption [message #1764667 is a reply to message #1764664] Thu, 01 June 2017 09:27 Go to previous message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
Happy to hear your resolved the problem so quickly :-)
Previous Topic:Scanner Discovery (Build Output Parser) doesn't work with -iquote
Next Topic:Eclipse don't start on MacOSX
Goto Forum:
  


Current Time: Fri Mar 29 12:11:13 GMT 2024

Powered by FUDForum. Page generated in 0.03458 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top