默认设置为“gcc”。但是说我的编译器的名字是' my _gcc',链接器'my_gcc‘和成员是'my_as’。
你是怎么用模板设置的??
我会认为您将执行以下操作:
<process type="org.eclipse.cdt.managedbuilder.core.SetMBSStringOptionValue">
<simple name="projectName" value="$(projectName)" />
<complex-array name="resourcePaths">
<element>
<simple name="id" value="cdt.managedbuild.tool.gnu.cross.c.compiler" />
<simple name="value" value="my_gcc" />
<simple name="path" value="" />
</element>
</complex-array>
</process>我需要在其他地方设置这些房产吗?
发布于 2014-03-21 09:15:13
无法找到基于模板的解决方案;但下面是一个编程解决方案:
//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];
//-----update command----//
ManagedBuildManager.setToolCommand(config, tool, "my_gcc");
ManagedBuildManager.saveBuildInfo(proj, true);然后,只需对需要修改的每个工具重复。
https://stackoverflow.com/questions/22122090
复制相似问题