Skip to content

Commit

Permalink
Update cc.md (#947)
Browse files Browse the repository at this point in the history
  • Loading branch information
chen3feng committed Jul 27, 2021
1 parent 9027be5 commit cd8a789
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/zh_CN/build_rules/cc.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CC 目标均支持的属性为:
`cc_library` 同时用于构建静态和动态库,默认只构建静态库,只有被设置了 `dynamic_link = True``cc_binary` 依赖时或者命令行指定 `--generate-dynamic` 才生成动态链接库。

cc_library生成的动态链接库里不包含其依赖的代码,而是包含了对所依赖的库的路径。这些库主要是为了开发环境本地使用(比如运行测试),并不适合部署到生产环境。
如果你需要生成需要在运行时动态加载或者在其他语言中作为扩展调用的动态库,应该使用 `cc_plugin` 构建规则,这样生成的动态库已经静态链接的方式包含了其依赖
如果你需要生成需要在运行时动态加载或者在其他语言中作为扩展调用的动态库,应该使用 `cc_plugin` 构建规则,这样生成的动态库已经以静态链接的方式包含了其依赖

示例:

Expand Down Expand Up @@ -406,7 +406,7 @@ lex_yacc_library(

## cc_plugin

把所有依赖的库都静态链接到成的so文件,供其他语言环境动态加载
生成一个通过静态链接方式包含了其所有依赖的动态链接库,用于在其他语言环境中动态加载

```python
cc_plugin(
Expand Down

0 comments on commit cd8a789

Please sign in to comment.