It is AMAZING how difficult it is to find this material. In addition to viewing plugin.xml, all templates provide effective work on the implementation of these parameters:
Source Link
View Templates
GNU C features for viewing
- Plugins /org.eclipse.cdt.managedbuilder.gnu.ui_X.XXxxxxx.jar/plugin.xml
Reverse engineering implementation example
The goal is to set the 'Cross GCC Compiler' โ Optimization โ 'Other optimization flags
- create a dummy C project without customization
open properties. set the target field manually. I set the "Other optimization flags" to "COME_FIND_ME"

open the .cproject file in the editor. find COME_FIND_ME. here is what i found:
<option id="gnu.c.compiler.option.optimization.flags.1380831355" superClass="gnu.c.compiler.option.optimization.flags" value="COME_FIND_ME" valueType="string"/>
- this is then the type 'string' and 'id' gnu.c.compiler.option.optimization.flags.

Search the plugin.xml list above for 'gnu.c.compiler.option.optimization.flags'. Here is what I found (on line 1120):
<option name="%Option.Posix.Optimize.Flags" category="gnu.c.compiler.category.optimization" id="gnu.c.compiler.option.optimization.flags" valueType="string"> </option>

exit this sample project and go back to your template.xml template to which you want to add this. we want to add a default here, so let's do it. add:
<process type="org.eclipse.cdt.managedbuilder.core.AppendToMBSStringOptionValue"> <simple name="projectName" value="$(projectName)" /> <complex-array name="resourcePaths"> <element> <simple name="id" value="gnu.c.compiler.option.optimization.flags" /> <simple name="value" value="-Omg_eclipse" /> <simple name="path" value="" /> </element> </complex-array> </process>
and what is he.
useful links
Notes
This is where the MBS add / set functions live:
- org.eclipse.cdt.managedbuilder.core.source_X.XXxxxxx.jar / org / eclipse / CDT / managedbuilder / templateengine / processes

Example full template file
finally, here is a snippet of code that can save you hours of cleaning up the Internet. this template.xml creates a new project by copying the main.c file and setting up three build options.
<?xml version="1.0" encoding="ISO-8859-1"?> <template type="ProjTempl" version="1.0" supplier="stack_overflow" revision="1.0" author="Justin Reina" id="EXE" label="My C Project" description="set some stuff."help="help.html"> <process type="org.eclipse.cdt.core.CreateSourceFolder"> <simple name="projectName" value="$(projectName)"/> <simple name="path" value="bsp"/> </process> <process type="org.eclipse.cdt.core.AddFiles"> <simple name="projectName" value="$(projectName)"/> <complex-array name="files"> <element> <simple name="source" value = "main.c"/> <simple name="target" value = "main.c"/> <simple name="replaceable" value = "true" /> </element> </complex-array> </process> <process type="org.eclipse.cdt.managedbuilder.core.AppendToMBSStringListOptionValues"> <simple name="projectName" value= "$(projectName)"/> <complex-array name="resourcePaths"> <element> <simple name="id" value="gnu.c.link.option.libs" /> <simple-array name="values"> <element value="corestuff" /> <element value="utilstuff" /> </simple-array> <simple name="path" value="" /> </element> </complex-array> </process> <process type="org.eclipse.cdt.managedbuilder.core.AppendToMBSStringOptionValue"> <simple name="projectName" value="$(projectName)" /> <complex-array name="resourcePaths"> <element> <simple name="id" value="gnu.c.compiler.option.optimization.flags" /> <simple name="value" value="-Omg_eclipse" /> <simple name="path" value="" /> </element> </complex-array> </process> <process type="org.eclipse.cdt.managedbuilder.core.SetMBSBooleanOptionValue"> <simple name="projectName" value="$(projectName)" /> <complex-array name="resourcePaths"> <element> <simple name="id" value="gnu.c.link.option.nostdlibs" /> <simple name="value" value="true" /> <simple name="path" value="" /> </element> </complex-array> </process> </template>
To the Eclipse Foundation; next time I can just pay you half the salary for you to give me this information.
source share