setPath
在 Path 中设置编译工具的路径和宏
语法
h.setPath(btpath,btmacro)
输入参数
示例
获取默认编译工具并设置其属性
以下示例代码显示向 MATLAB® Coder™ 编译过程添加自定义工具链教程中 intel_tc.m 文件的一部分中的 setPath。
% ------------------------------
% C Compiler
% ------------------------------
tool = tc.getBuildTool('C Compiler');
tool.setName('Intel C Compiler');
tool.setCommand('icl');
tool.setPath('');
tool.setDirective('IncludeSearchPath','-I');
tool.setDirective('PreprocessorDefine','-D');
tool.setDirective('OutputFlag','-Fo');
tool.setDirective('Debug','-Zi');
tool.setFileExtension('Source','.c');
tool.setFileExtension('Header','.h');
tool.setFileExtension('Object','.obj');
tool.setCommandPattern('|>TOOL<| |>TOOL_OPTIONS<| |>OUTPUT_FLAG<||>OUTPUT<|');
以交互方式使用 getPath 和 setPath 方法
此示例说明 MATLAB® 命令行窗口中方法的输入和输出示例:
输入以下行:
tc = coder.make.ToolchainInfo;
tool = tc.getBuildTool('C Compiler');
tool.getPath
ans =
''tool.getPath('macro')
ans = CC_PATH
tool.setPath('/gcc')
tool.Pathans = Macro : CC_PATH Value : /gcc
版本历史记录
在 R2013a 中推出