C++ 构建系统 [英] C++ build systems

查看:31
本文介绍了C++ 构建系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很快就会开始一个新的 C++ 项目(它可能也有一些 C 组件),我正在寻找一个现代的、工业强度(即非测试版)构建系统.该软件将由几位开发人员在 3-5 年内创建,并将在 Linux 上运行(Mac OS X 和 Windows 可能稍后支持).我正在寻找比例如具有更好的可理解性、易用性和可维护性的东西.make 但仍然足以处理复杂的项目.开源软件优先.

I will start a new C++ project (it may have some C components as well) soon and I am looking for a modern, industrial-strength (i.e. non-beta) build system. The software will be created by several developers in 3-5 years and will run on Linux (Mac OS X and Windows might be supported later). I am looking for something that has better comprehensibility, ease-of-use and maintainability than e.g. make but is still powerful enough to handle a complex project. Open source software is preferred.

到目前为止,我开始研究 Boost.BuildCMakeMavenSCons 并喜欢功能和所有这些的概念,但我缺乏为大型项目做出决定的经验.

I started looking into Boost.Build, CMake, Maven and SCons so far and liked features and concepts of all of those, but I'm lacking the experience to make a decision for a large project.

推荐答案

我已经使用 SCons 超过一年了,真的很酷.这是一个完整的构建系统,而不是构建脚本生成器.

I've used SCons for over a year now and it's really cool. It's a full build system, not a build scripts generator.

它是基于 Python 的,您可以在 Python 中编写 SConstruct 和 SConscript(相当于 Makefile),这允许您调用您可能希望的任何可用库,以及 Makefile 授权的更清晰的语法.

It's Python based, and you write the SConstruct and SConscript (equivalent of Makefile) in Python which allows you to call any available library you may wish for and a much clearer syntax that what a Makefile authorize.

由于 Python 是跨平台的,SCons 也是如此,所以没问题.

Since Python is crossplatform, so is SCons, no problem there.

它捆绑了大量目标:

  • 检测可用的二进制文件并自动将许多扩展映射到正确的二进制文件
  • 根据操作系统检测对象/库的正确扩展名,但您可以覆盖它
  • 为Move、Copy、Tar等常见操作(构建后延迟)提供工具,您可以提供自己的python脚本并钩住它们
  • 开箱即用,但在每个级别都提供了许多自定义功能

它真的很高效,甚至提出了高级功能(比如将预处理文件的哈希存储在 sqlite 数据库中,而不是使用时间戳),即使您最终决定了策略.

It's really efficient, and even proposes advanced features (like storing a hash of the preprocessed file in a sqlite db instead of using the timestamp) even though you decide of your strategy in the end.

它还免费提供依赖循环检测(Makefiles 绝对不提供的东西),并且界面通常更好/自动化.

It also offers dependencies cycle detection for free (something that definitely does not come with Makefiles) and the interface is generally just better / automated.

我说它有效吗?好吧,它显然允许并行执行多个作业;)

Did I say it was efficient ? Well it obviously allows for multiple jobs to be executed in parallel ;)

而且它也是免费的,就像免费饮料一样,随意贡献;)

And it's also free, like in free drink, feel free to contribute ;)

我只能推荐它.

这篇关于C++ 构建系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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