cc_library和cc_import之间的区别

发布于 2025-02-06 19:55:21 字数 470 浏览 1 评论 0原文

cc_library https://docs.bazel.build/versions/main/be/c-cpp.html#cc_import“ rel =“ nofollow noreferrer”> cc_import 当导入prebuild so so库时。

我注意到

  1. cc_library可以使用多库,但是cc_import只能使用一个。
  2. cc_library可以使用strip_include_prefixcc_import not。

what's difference between cc_library and cc_import when import prebuild so library.

I noticed that

  1. cc_library can use multi library but cc_import can just use one.
  2. cc_library can use strip_include_prefix but cc_import not.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青朷 2025-02-13 19:55:21

cc_librarycc_import之间的区别在于,第一个是旨在编译共享库(.so/code>/.dll 文件),并将其作为其他目标的依赖性,例如可执行文件或测试。从本质上讲,它要求您拥有整个库源代码并从头开始构建,同时使用CC_IMPORT来链接系统中已经存在的Prebuild库。这样,您可以使用诸如Boost或QT之类的外部依赖关系,并且无需对这些库的干净构建。

The difference between cc_library and cc_import is that the first one is intended to compile a shared library (.so/.dll files) and make it available as a dependency for other targets, such as executables or tests. It essentially requires you to have your whole library source code and builds from scratch, meanwhile cc_import is used to link prebuild libraries that already exist in your system. This way, you can use external dependencies like Boost or Qt and do not need to do a clean build of those libraries.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文