将gcc命令行转换为Eclipse CDT项目文件 [英] Convert gcc command line into Eclipse CDT project file
问题描述
我有一个远程交叉构建,我想从makefile构建中手动获取gcc命令行,并使用它来设置包含包含路径和预处理程序定义的Eclipse CDT项目文件。我怎样才能做到这一点?
I have a remote, cross build and I would like to manually take the gcc command line from the makefile build, and use it to setup the Eclipse CDT project file with include paths and preprocessor definitions. How can I do this?
推荐答案
通常的方法是使用 Build Output Parser (构建输出解析器)。
The usual way to do this is using the Build Output Parser.
- 创建Makefile项目
-
在
项目属性中启用构建输出解析器| C / C ++常规|预处理器包括路径,宏等。 Providers选项卡
(可能已启用)。
- 必要时进行配置(例如 Compiler命令模式可能需要进行调整以匹配您的交叉编译器的名称。)
请确保您可以从内部构建项目蚀。如有必要,请在 Project Properties | Project中配置make目标名称和调用目录。 C / C ++构建
。
Make sure you can build the project from within Eclipse. If necessary, configure the make target name and invocation directory in Project Properties | C/C++ Build
.
从Eclipse内部调用构建。
Invoke the build from within Eclipse.
- 构建输出解析器将在构建结束时自动运行,解析构建输出中的编译器命令,并根据命令配置项目的包含路径和预处理器定义。
注意:要使其正常工作,构建输出实际上需要包含原始编译器命令。有时,例如对于CMake生成的makefile,默认情况下不会启用它,但是有一个选项可以启用它-如果是这样,请确保在 Project Properties | Project Properties |中指定了 Build command。 C / C ++ Build
包含该选项。
Note: for this to work, the build output needs to actually contain the raw compiler commands. Sometimes, e.g. with CMake-generated makefiles, it doesn't by default but there is an option to enable it - if so, be sure that the "Build command" specified in Project Properties | C/C++Build
contains that option.
这篇关于将gcc命令行转换为Eclipse CDT项目文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!