C/C++ 开源项目构建

构建 C/C++ 开源项目目前有两大类,一是gnu build tools,二是cmake。

GNU Build Tools

configure.ac && m4

使用dnl表示注释

一些编译宏的解释
AC_COMPILE_IFELSE(input, [action-if-true], [action-if-false])根据对input进行编译,如果成功则执行action-if-true,如果失败则执行action-if-false

AC_SUBST 将定义的变量赋值到makefile中

AC_DEFINE_UNQUOTEDAC_DEFINE 添加宏定义,如 AC_DEFINE_UNQUOTED([ENABLE_WALLET],[1],[Define to 1 to enable wallet functions]) 等价于 #define ENABLE_WALLET 1
所不同的是,AC_DEFINE_UNQUOTED 支持shell语言的替换,如:variable expansion (‘$’), command substitution (‘`’), and backslash escaping (‘\’)

Cmake

数据结构与算法笔记 | 分治 从C++到Java —— C系列编程语言辨析总结

Comments

You forgot to set the shortname for Disqus. Please set it in _config.yml.
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×