bazel build instructions notes

bazel notes:

 Compile bazel is based on the work area, which is the root directory of the project 

1. workspace file: the development of the current folder is a bazel workspace. 

2. One or more build files, if a directory workspace contains the build file, then he is a package. Therefore, to develop a directory of bazel workspace, you simply create an empty workspace in the directory that is can. 

//: file under the symbol identifies the root directory 

target:

cc_binary (name) 

 cc_libary 

 cc_test



Visualization:

 bazel query --nohost_deps --noimplicit_deps 'deps(//main:hello-world)' --output graph  

 bazel There are two key elements, a Package is, the other is a target package are independently compiled project packet, identified by the document workspace (which may be empty); BUILD target file is a key element, which is compiled object, the target can be a binary file (cc_binary), may be libary (cc_libary)  



Additional options:

visiblity: ["//visibility:public"],['//visibility:private'](私有),['//some/package:__pkg__'](注意冒号) ex: package(default_visibility = ["//visibility:public"])

Reproduced in: https: //www.jianshu.com/p/96b9ddb25d0f

Guess you like

Origin blog.csdn.net/weixin_34124939/article/details/91314802