- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
经过大量搜索和阅读大量资料后,我无法决定应该使用哪种工具来编译我的代码。我的代码库主要是 C++。我主要使用 Linux 作为我的开发机器。
根据我之前阅读的意见,我的最终候选人是 waf和 cmake , 但我自己无法决定哪一个更合适。
我的主要要求是:
一些强烈的偏好是:
一些问题:
目前我的感觉是,我更喜欢 waf 作为一种工具,但无论出于何种原因,cmake 似乎都相当成功。
最佳答案
不太了解 waf,但 CMake 非常适合您的要求。我知道 waf 是用 Python 编写的,这是我个人最喜欢的 ATM 编程语言。
My primary requirements are:
Must be able to compile software in windows/linux and android.
CMake 可以很好地处理 Windows 和 Linux,但其他值得一提的构建系统也是如此。 Someone wrote some Android scripts for CMake.找不到与 waf 类似的东西(我的 Google-fu 什么也没找到。)
Must be ready to run tests.
CMake 有一个兄弟 testing framework .
Must be able to play nicely with other libraries that must be compiled with another build system but most likely will have to be compiled from source.
CMake has good integration with pkg-config ,并且可以链接到任意共享库。
Must be able to add custom steps, like for example, generating some data from some files (mainly graphics) before compiling, all integrated in the build system.
CMake can generate custom rules .
Some strong preferences are:
Being ready to support MAC compilation.
CMake 对 Mac 的支持很好。如果你愿意,它甚至可以让你成为一个 Xcode 项目,但它也可以进行命令行构建。
Being able to cross-compile from linux as many platforms as I can (maybe windows/linux/android but cannot MAC?)
Cross-compiling is supported in CMake . CMake 不会成为交叉编译的主要痛苦来源——实际上其他一切都会。
特别是关于 Mac 的交叉编译。有可能,但不值得针对该平台进行交叉编译,考虑到您无论如何都需要访问 Mac 来获取库和头文件,您需要修补 GCC 和 clang 以及 LLVM 等。我唯一合理的理由听说经历了这么多痛苦是运行一个自动构建服务器。无论如何,如果你有一个工作的 Linux -> Mac 工具链,你应该能够与 CMake 交叉编译,就好像它是任何其他 Unix 平台一样。
Being able to add support for iOS compilation if the need arises.
iOS cross-compilation can be done ,但您需要一台 Mac。
Would be nice if the invocation interface was similar to that of autotools, since it is the one many people know and it is well documented.
编写一个仅调用 CMake (cmake .
) 的配置脚本。然后您的用户可以在有意义的平台上执行 ./configure && make && make install
。还有 CPack它允许您生成 DEB、RPM、NSIS (Windows) 和 DMG (Mac) 安装程序/包。
Some questions:
If I have some rare requirement, which build system would be more ready to be extended?
CMake 的可扩展性很强。它可以扩展以支持新的语言和目标平台。 (鉴于 waf 是用 Python 编写的,它也很容易破解。)
Are both currently well maintained? (I wonder about waf mainly).
CMake 成熟且维护良好。
Community: if I find a problem, both communities are big enough to support me, in your experience?
老实说,社区和可用的扩展是让我从 bakefile 之类的东西回到 CMake 的原因。
关于android - cmake 与 waf : mainly for c++ windows/linux and android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19238420/
因此,当使用“智能”时,当我想创建一个类时,它还会创建另外两个函数(不确定我是否正确调用了它们): class main { private: /* data */ public: m
我确实知道 C/C++ 和 Java 中使用的 main() 方法,但由于 main() 是用户定义的(因为 main() 中的代码是由用户定义的,它不能是预定义的方法) & 在 C/C++ 中,ma
这个问题在这里已经有了答案: What is a NullPointerException, and how do I fix it? (12 个答案) 关闭 7 年前。 我意识到这是一个常见错误,
您好,我是 jquery 和 javascript 的新手。我想做的是我有 3 个独立的 Main-Divs ex main-div1, main-div2, main-div-3 它们都是一个大盒子
我知道以前曾有人问过有关此错误的问题,但我的情况与其他人不同。我正在编写计算数据集的平均值、方差和标准差的代码。编译代码时我没有收到任何错误,但是当我尝试运行代码时,我收到如下错误: Exceptio
这个问题已经有答案了: What should main() return in C and C++? (19 个回答) Why is the type of the main function in
无效的输入流不起作用 - 每次我给出负的月份值时,它都会返回此异常。 代码: import java.util.Scanner; public class Main { public stat
我在 main() 中调用 main(),递归 10 次。现在,在使用 gdb (bt/backtrace) 进行调试时,我没有看到 main() 的多个帧。为什么? #include int mai
我有一个类 - A - 没有方法,只有主要方法。 在其他类(class) - B - 我需要调用那个 main.做什么最好?从使用的资源、时间和功耗以及效率来看? 从类 A 创建一个“a”对象并执行
鉴于 documentation以及对 earlier question 的评论,根据要求,我制作了一个最小的可重现示例,演示了这两个语句之间的区别: my %*SUB-MAIN-OPTS = :na
我有一个在 main 中声明并初始化的数组,名为 Edges。 我还在 main 中声明了一些访问名为 Edges 的数组的函数。 代码编译并运行。 为什么它有效?我认为 main 中声明的变量不是全
如果定义内容主要部分的最具语义性和可访问性的方式是标准,那么使用 ARIA 地标似乎是多余的元素。正在添加 role="main"到元素真的有必要吗? 最佳答案 并非所有现代浏览器都已经映射了 ari
我是 C 语言的新手(6 小时前开始),我知道有大量的在线引用资料,我应该(并且将会)详细查看,但现在,我有紧急情况需要帮助。我有一个包含以下文件的项目文件夹: boundary_val.c boun
我正在审查许多不同的 Java 程序,并试图弄清楚如何只更新一次而不是两次更新对程序名称的引用。有没有办法在单个终端命令中使用变量? :S 我试图改进的命令是这样的形式: javac Main.jav
我已经创建了一个工作线程, Thread thread= new Thread(runnable); thread.start(); 我在工作线程中打印这个; Log.d("SessionTh
import java.awt.*; import java.awt.event.*; import java.io.*; import java.lang.*; public class Main
这是我的 Main.java,它位于服务器套接字“get().logger().tag();”之后的部分我已经在实例中添加了所有这些,我真的不确定它出了什么问题。 public class Main
我在 http://www.hackerearth.com/problem/algorithm/roys-life-cycle/ 上测试了我的程序。但是,我总是收到错误:在类 ActivityTime
我想要一个脚本来运行从模块导出的子例程,导出的子程序在脚本中作为 MAIN 运行。该子例程做了我想做的所有事情,除了它返回结果而不是打印它。 RUN-MAIN 似乎实现了我的大部分目标,但我不确定如何
java中有什么具体原因吗,main方法应该是小写字母 是的“主要”和“主要” 编译完成 public class ManiMethod { public static void main(S
我是一名优秀的程序员,十分优秀!