cc_library和cc_import之间的区别
cc_library https://docs.bazel.build/versions/main/be/c-cpp.html#cc_import“ rel =“ nofollow noreferrer”> cc_import 当导入prebuild so so库时。
我注意到
cc_library
可以使用多库,但是cc_import
只能使用一个。cc_library
可以使用strip_include_prefix
但cc_import
not。
what's difference between cc_library and cc_import when import prebuild so library.
I noticed that
cc_library
can use multi library butcc_import
can just use one.cc_library
can usestrip_include_prefix
butcc_import
not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
cc_library
和cc_import
之间的区别在于,第一个是旨在编译共享库(.so
/code>/.dll 文件),并将其作为其他目标的依赖性,例如可执行文件或测试。从本质上讲,它要求您拥有整个库源代码并从头开始构建,同时使用CC_IMPORT来链接系统中已经存在的Prebuild库。这样,您可以使用诸如Boost或QT之类的外部依赖关系,并且无需对这些库的干净构建。
The difference between
cc_library
andcc_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.