如何在 Eclipse 中组织一个 C 项目/w 多个二进制文件?

发布于 2024-08-23 17:47:16 字数 166 浏览 1 评论 0原文

我正在将一个项目转换为 Eclipse CDT,它由 2 个(静态)库组成,并生成大约 12 个二进制文件,其中一些二进制文件有 2-3 个不同的构建配置,并由 scons 构建

我应该如何构建这是在 Eclipse 工作区中吗? 1 个项目解决所有问题?每个二进制文件/库有 1 个项目?还有别的吗?

I'm in the process of converting a project to Eclipse CDT, it consists of 2 (static) libraries and produces about 12 binaries, a few of the binaries have 2-3 different build configurations, and is built by scons

How should I structure this in an Eclipse workspace ? 1 project for everything ? 1 project for each of the binaries/libs ? Something else ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

云淡风轻 2024-08-30 17:47:16

我建议你使用 CMAKE 来解决这个问题,它应该能够针对 Eclipse 构建系统。如果没有,它可以为您生成一个正常的“make”配置。沿着这条路线走要好得多,因为从长远来看它更具可移植性,并且编写分层构建系统非常简单。

I'd suggest you use CMAKE for this problem, It should be able target target the Eclipse build system. If not, it can generate a normal 'make' config for you. It is far better to go down this route since its more portable in the long term, and writing a hierarchical build system is quite straight forward.

冷默言语 2024-08-30 17:47:16

我个人以前使用过 Eclipse CDT,但仅在 makefile 模式下使用,即构建任何我需要手动运行 makefile 的内容。基本上我使用 Eclipse 作为一个美化的编辑器。我的工作方式如下:

其他解决方案的所有部分都位于同一个工作区下。每个库/二进制文件都有自己的目录和项目,因此我可以根据需要make每个库/二进制文件。我还有一个单独的文件夹(项目)用于使用 makefile 进行测试,该 makefile 构建了我想要运行的所有测试 exe,以便我可以对其简单的部分进行 valgrinds。

正如我所说,我使用了 make 而不是 Eclipse CDT 的内置构建例程 - 为此,我想说,如何构建它并不重要 - 做任何有意义/最符合 UNIX 原则的事情。

I personally have used Eclipse CDT before, but only in makefile mode i.e. to build anything I'd manually run the makefile. Basically I used Eclipse as a glorified editor. Here's how I worked things:

Everything part of the otherall solution came under the same workspace. Each library/binary was its own directory and project, so that I could make each as required. I also had a separate folder (project) for tests with a makefile that built all the test exes I wanted to run so I could do valgrinds on simple bits of it.

As I said, I used make and not Eclipse CDT's built-in building routines - to that end I'd say it really doesn't matter how you structure it - do whatever makes sense / conforms best to the UNIX principles.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文