Nordlöw
Nordlöw

Reputation: 12138

Pre-built Library Targets

Is there a way to specify a Bazel target like with cc_library but for an existing pre-built static or shared library.

I couldn't find a reference to such a rule in the Bazel documentation.

Upvotes: 0

Views: 497

Answers (2)

MHStag
MHStag

Reputation: 81

The cc_import rule does precisely what you're asking and I believe a little bit cleaner than the accepted answer.

Upvotes: 1

László
László

Reputation: 4271

You can use cc_library itself, just put .so files in cc_library.srcs. See the docs.

Upvotes: 2

Related Questions