Skip to main content

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

> 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) {
 ... 
> 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.


The problem might be that when you are in the properties dialog you
are working with a copy of the original project settings. Only when
you press 'Apply' or 'Ok' these working copy settings are transfered
to the actual '.cproject' project settings. So using

  IOption MlibOpt = ManagedBuildManager.getProjectType("stxp.target.sx.w32.exe").getConfiguration("...").getTool("...").getOptionBySuperClassId("...");

will get you the original project option, not the actual working
copy. To get the latter I think you should use the 'IBuildObject
configuration' parameter passed to 'isOptionEnabled()'. From that
value you can get the IConfiguration value which in turn can be used
to get the linker tool, and using ITool.getOptions() to get
the dynamic options (the ones with the random number, if changed).

-- Wieant


Back to the top