问题
I have built a lib.so using make rule in bazel. How do I link this external lib.so to a regular cc_library rule. I tried adding it in deps, but the guide suggests that deps can have cc_library or objc_library targets.
Also, do I need to pass any specific linking options, and how can I read more about them?
回答1:
In the BUILD file, create a cc_library
target that imports the built lib.so
for other cc_library
targets to depend on:
cc_library(
name = "lib",
srcs = ["lib.so"],
linkopts = ["...", "..."],
)
See the documentation on C++ use cases for more information.
来源:https://stackoverflow.com/questions/58329033/how-to-link-a-library-build-using-make-rule-in-bazel