your walk on a dark and lonely road, my friend :). but hilarious nonetheless.
Settings on a Custom Toolchain / Tool
Here is an example when someone tried to programmatically set the GNU tools / tools parameters:
*, and here is the same author's background thread when solving it:
What he did here will lead you to your decision. I would suggest looking at the plugin.xml org.eclipse.cdt.managedbuild.gnu.ui file first. Focus on tools, tools and their options.
Finding GNU C Tools / Tools Options
Also, here is a useful article that I returned a bit, "finding dang parameters in a GNU C project." Not an exact question with an OP, but the answer is relevant to your question.
Conclusion
I very much doubt that you will find the answer <10 lines of code, even to set the -v flag for the compiler ... If you find a simple result, I would suggest placing it here as a continuation.
Good luck
EDIT . I have been nibbling this for some time because I recently stumbled / failed. Here's how to set parameters from code.
//assumptions //#1 project is [0] in workspace //#2 compiler is [2] in workspace //get project IProject proj = ResourcesPlugin.getWorkspace().getRoot().getProject("hello_world"); //get <storageModule moduleId="org.eclipse.cdt.core.settings"> IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(proj); //get <storageModule moduleId="cdtBuildSystem"> IManagedProject sub_info = info.getManagedProject(); //get <configuration name="Debug"> IConfiguration config = sub_info.getConfigurations()[0]; //get <toolChain> IToolChain toolchain = config.getToolChain(); //get <tool name="GCC C Compiler"> ITool tool = toolchain.getTools()[2]; //get <option> IOption option = tool.getOptionBySuperClassId("gnu.c.compiler.option.misc.other"); //----append new flag----// String new_opt_value = option.getValue() + " -mySuperFlag"; //-----store it----// ManagedBuildManager.setOption(config, tool, option, new_opt_value); ManagedBuildManager.saveBuildInfo(proj, true);
Notes - as soon as you start viewing this operation as an "Eclipse Resource", the methodology becomes (somewhat ...) understandable - each call of an object to access a field is simply access to another section in the XML schema of the .cproject resource
Hope this helps!