demo4示例 链接第三方动态库,静态库。 使用cc_import链接外部库。原理是通过cc_import规则导入第三方库,然后cc_binary再依赖cc_import规则的target,也即依赖第三方库。 demo4目录树 ├── link │ ├── BUILD │ ├── include │ Read More
posted @ 2018-10-23 09:05 suonikeyinsu Views(14004) Comments(0) Diggs(0) Edit
demo3 使用bazel编译静态库 demo3目录树 ├── README.md ├── static │ ├── BUILD │ ├── static.c │ └── static.h └── WORKSPACE BUILD 本例中,包名即目录名static,cc_library规则的name也 Read More
posted @ 2018-10-23 09:04 suonikeyinsu Views(3700) Comments(0) Diggs(0) Edit
demo2_1目录树 ├── app │ ├── BUILD │ ├── hello_world.cpp │ └── lib │ ├── BUILD │ ├── func.cpp │ └── func.hpp ├── README.md └── WORKSPACE 我们知道子目录下再创建一个BUIL Read More
posted @ 2018-10-23 09:01 suonikeyinsu Views(165) Comments(0) Diggs(0) Edit
demo2_2 使用baze编译动态库 demo2_2目录树 ├── app │ ├── BUILD │ ├── func.cpp │ └── func.hpp ├── README.md └── WORKSPACE BUILD: cc_binary.srcs 1. 支持的文件类型 c/c++源文件 Read More
posted @ 2018-10-23 09:01 suonikeyinsu Views(2214) Comments(0) Diggs(0) Edit
demo2 使用bazel编译多目标示例,一个bianry,一个library。 demo2目录树 ── demo2 ​ ├── app ​ │ ├── BUILD ​ │ ├── func.cpp ​ │ ├── func.hpp ​ │ └── hello_world.cpp ​ ├── REA Read More
posted @ 2018-10-23 08:58 suonikeyinsu Views(1125) Comments(0) Diggs(0) Edit
demo1 使用bazel编译一个源文件生成可执行程序简单示例 demo1目录树 demo1 ├── app │ ├── BUILD │ └── hello_world.cpp ├── README.md └── WORKSPACE workspace A workspace is a direct Read More
posted @ 2018-10-23 08:55 suonikeyinsu Views(2155) Comments(0) Diggs(0) Edit