0
点赞
收藏
分享

微信扫一扫

使用blade编译C/C++

一条咸鱼的干货 2022-02-20 阅读 84

零、搭建blade


0、ubuntu安装python3

sudo apt-get update
sudo apt-get python3
ln -s /usr/bin/python3.5 /usr/bin/python

1、安装ninja

#clone 仓
git clone https://github.com/ninja-build/ninja.git

#编译
cd ninja
./configure.py --bootstrap

#安装
cp ./ninja  /usr/bin 
ninja --version

2、安装blade

git clone https://github.com/chen3feng/blade-build.git
cd blade-build
./install 

一、示例


0、hello world

同一个目录下:main.cpp, BUILD, BLADE_ROOT

main.cpp

#include <iostream>
using namespace std;

int main()
{
    cout << "hello world" << endl;
    return 0;
}

BUILD

cc_binary(
   name = 'main',
   srcs = [
     'main.cpp',
   ],
 )

 BLADE_ROOT文件没有内容

编译:

blade build .
举报

相关推荐

0 条评论