Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] How to manage one option from one holder(tool) by another option owned by another Holder(tool)

  
Hello 
PLZ, I want to manage one boolean LINKER option 
By another boolean COMPILER option.
I implemented the applicability calculator of the COMPILER option to set
The LINKER option : I used the code below: 
-----------------
public boolean isOptionEnabled(IBuildObject configuration,
			IHoldsOptions holder, IOption option) {

		 if (configuration.getBaseId().contains(
			"configuration.sx.w32.debug.cc")) {
		try {
			IOption MlibOpt = ManagedBuildManager
	
.getProjectType("stxp.target.sx.w32.exe")
					.getConfiguration(
	
"stxp.configuration.sx.w32.debug.cc")
					.getTool(
	
"stxp.tool.configuration.sx.w32.debug.linker.cc")
					.getOptionBySuperClassId(
	
"stxp.option.linker.cc.lib");

			ManagedBuildManager
	
.getProjectType("stxp.target.sx.w32.exe")
					.getConfiguration(
	
"stxp.configuration.sx.w32.debug.cc")
					.getTool(
	
"stxp.tool.configuration.sx.w32.debug.linker.cc")
					.getOptionToSet(MlibOpt,
false).setValue(
	
option.getBooleanValue());

		} catch (BuildException e) {
			e.printStackTrace();
		}
	}
Return true;
}
-----------------------------
This method works, as long as, the LINKER option is not set manually.
Once this later is set manually the compiler option won't manage the linker
option any more.
Another investigation,
This method manages the linker option without registring the linker option
in the ".cproject"
But once the linker option is set manually this later is registered in the
".cproject" and 
I think that is why it won't be managed by the compiler option any more
since this implemented
Method uses the static IDs of the options and not the dynamic IDs in the
".cproject", and I don't find the way
To manage the baseId in this file.

Thanks for your help.
KHALED ABDA



Back to the top