Eclipse CDT Project Template - Setting Drop-Down Options

柔情痞子 提交于 2019-12-02 00:17:55
Jonah Graham

The way to do this option is to treat it as a string and the internals with change the string value to the enum value. I tested it with C99 (i.e. not C++), for which I used this:

<!--  Set -std=c99 by selecting the enum in the settings -->
<process
    type="org.eclipse.cdt.managedbuilder.core.SetMBSStringOptionValue">
    <simple name="projectName" value="$(projectName)" />
    <complex-array name="resourcePaths">
        <element>
            <simple name="id" value=".*compiler\.option\.dialect\.std.*" />
            <simple name="value" value="ISO C99 (-std=c99)" />
            <simple name="path" value="" />
        </element>
    </complex-array>
</process>

So for your solution I expect this will work. Note that the value is whatever is displayed to the user:

<process
    type="org.eclipse.cdt.managedbuilder.core.SetMBSStringOptionValue">
    <simple name="projectName" value="$(projectName)" />
    <complex-array name="resourcePaths">
        <element>
            <simple name="id" value=".*cpp\.compiler\.option\.dialect\.std." />
            <simple name="value" value="gnu.cpp.compiler.dialect.c++11" />
            <simple name="path" value="" />
        </element>
    </complex-array>
</process>

Compared to your version, I changed the process type and the whole name="value" element (from simple-array to simple plus internal name to display name).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!