1. makefile-cmake 打印 git commit 等编译信息
本方法记录如何在程序中打印版本信息,比如 git commit id, git branch, git tag, 编译时间,编译用户等
1.1. 前置条件及目的
目的:在编译时,记录 git commit 信息,打印到日志中,方便调试定位问题
举例:
目录结构如下
├── build.sh
├── CMakeLists.txt
├── config.h.in
├── makefile
└── src
├── CMakeLists.txt
└── main.c
先定义 conf

最低0.47元/天 解锁文章
622

被折叠的 条评论
为什么被折叠?



