Hi Warren,
Thanks for your response.
Earlier, I had played around a bit with Command-line generators (but at the option level). I had noticed that at least the 'All Options' scroll box in the Build Settings UI for tools was not getting updated when I changed the toolchain-level option value. The command generator was getting invoked but it was NOT picking the value entered in the UI, but was picking the value saved earlier probably in the .cproject file. The code for the command-generator for the option (added on the invisible option) is inlined below:
public String generateCommand(IOption option, IVariableSubstitutor macroSubstitutor) {
// get the selected project from workbench
IProject p = getSelectedProject();
if (p == null) return "";
IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(p);
IConfiguration activeConfig = buildInfo.getDefaultConfiguration();
IToolChain tc = activeConfig.getToolChain();
for (IOption optn : tc.getOptions()) {
if (option.getBaseId().equals("my.toolchain.compiler.model"))
{
if (optn.getBaseId().equals("my.toolchain.general.model")) {
return "--model" + optn.getValue();
}
}
}
return "";
}
My questions are:
1. Does the command-generator always picks the saved settings (from .cproject) and not from the UI? Would even the tool-level command generator (as you recommend) do the same? Or, is above code not correct to access tool-chain option value?
2. Does pressing 'Ok' on the C++ Build Settings dialog guarantee that the settings are saved on the file-system? I've sometimes noticed that the changes done in the build-settings UI are not getting reflected in the .cproject file?
Thanks,
Ashutosh