Bartleby implements a Bazel rule that can be used to execute the Bartleby tool on a set of Bazel targets.
Rule definition
bartleby
bartleby(name, prefix, srcs)
Run Bartleby on a set of libraries.
This outputs a target that provides a CcInfo
provider.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
name | A unique name for this target. | Name | required | |
prefix | Prefix to apply to library's symbols | String | optional | "" |
srcs | Libraries to give to bartleby. These targets have to provide a CcInfo provider. | List of labels | required | |
Example
load("@com_sandboxquantum_bartleby//:rules.bzl", "bartleby")
cc_library(
name = "api_1",
srcs = ["api_1.c"],
hdrs = ["api_1.h"],
copts = [
"-fvisibility=hidden",
],
deps = [
":external_dep",
],
)
cc_library(
name = "api_2",
srcs = ["api_2.c"],
hdrs = ["api_2.h"],
copts = [
"-fvisibility=hidden",
],
deps = [
":api_1",
":external_dep",
],
)
cc_library(
name = "external_dep",
srcs = ["external_dep.c"],
hdrs = ["external_dep.h"],
copts = [
"-fvisibility=hidden",
],
)
name = "external_dep_versioned",
srcs = [":external_dep"],
prefix = "__private_1.2.3_",
)
Definition: Bartleby.h:32
- See also
- bazel/BUILD.bazel example