如何使用Eclipse CDT构建SCons项目? [英] How to build SCons projects with Eclipse CDT?

查看:255
本文介绍了如何使用Eclipse CDT构建SCons项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个相当大的C / C ++项目,使用建筑的scons。我想通过Eclipse-CDT来尝试构建它。任何人都有这方面的经验,可以告诉我建立一个建立者的机会。 (不使用SConsBuilder插件,它将不适用于Fedora-11中的Eclipse-CDT)。

We have a fairly large C/C++ project using scons for the building. I'd like to go at an attempt to build this through Eclipse-CDT. Anyone have any experience with this and can tell me the steps to set up scons as a builder. (NOT using the SConsBuilder plugin, it will not work with the Eclipse-CDT from Fedora-11).

推荐答案

尝试 Eclipse中的Waf CDT 之前,SCons将会非常相似。解决方案是创建一个空的Makefile项目,然后在选项中将make更改为scons。在Windows上,可能需要您的路径中的scons.bat文件。这不如创建一个虚拟Makefile,它具有一个 all:\\\
\tscons
类型模式,但是最少的工作。

I've tried Waf in Eclipse CDT before now, SCons would be really similar. The solution was to create an empty Makefile project, then simply change "make" to "scons" in the options. On Windows that would probably need the scons.bat file in your path. That is not much better than creating a dummy Makefile that has an all:\n\tscons type pattern in it, but is the least work.

SConsBuilder插件不是一个好主意它有一大堆硬编码的python代码,它吐出了一个SConstruct。它没有在年龄更新,现在很多代码可能已经在SCons中被淘汰了。我认为一个更好的方法是做SCons对于Visual Studio,或者CMake为Eclipse CDT做什么。这意味着根据您的构建配置即时生成.cproject文件。

The SConsBuilder plugin is not a good idea. It has a whole bunch of hard coded python code in there that it spits out to a SConstruct. It hasn't been updated in ages and a lot of code is probably deprecated in SCons by now. I think a better approach is to do what SCons does for Visual Studio, or what CMake does for Eclipse CDT. That means generating a .cproject file on the fly based on your build configuration.

我写了一个用于Waf的Eclipse项目生成器,一段时间,它们构建节点收集源文件并吐出一个.project和.cproject文件。与CMake的做法类似,但是Waf默认的创建变体目录的行为意味着您不必处理源代码生成问题。此后,它已添加为额外的waf本身。它仅使用Waf API的一部分,因此可以将其转换为具有少量工作量的SCons。换句话说,没有什么太多了。 .cproject格式并没有真正记录在任何地方,与Java版本相比,真的很丑陋。

I wrote an Eclipse project generator for Waf at one point, which walks the build nodes gathering source files and spits out a .project and .cproject file. Similar to how CMake does it, but Waf's default behaviour of creating a variant directory means you don't have to deal with out-of-source build issues. This has since been added as an extra in waf itself. It uses only part of the Waf API so it would be possible to convert it to SCons with some small-ish amount of work. In other words, there's nothing much out there. The .cproject format is not really documented anywhere and is really ugly compared to the Java version.

尽管CDT并没有太好地使用,在Java开发工具的背后,我仍然使用Vim与:make ,所以最终都有点学术。

I didn't get on too well with CDT though - it is a long way behind the Java dev tools - and I still use Vim with :make, so it was all a bit academic in the end.

这篇关于如何使用Eclipse CDT构建SCons项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆