自动化构建工具——scons

2018-07-17  本文已影响0人  cp3_1dbc

之前只用过make和cmake,无意中看到了有这样一个c/c++项目的构建工具,想试试看怎么样。

安装

scons的官网,可以在这里下载
https://scons.org/, 怎么装就不用说了吧。

使用方法

#include <iostream>
using namespace std;

int main()
{
    cout << "Hello world" << endl;
    return 0;
}
Program('hello_world.cc')
$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o hello_world.o -c hello_world.cc
g++ -o hello_world hello_world.o
scons: done building targets.

可以看到生成了一个可执行文件 hello_world

上一篇 下一篇

猜你喜欢

热点阅读