https://github.com/ryanmcdermott/rules_cc_embed_data
Bazel rule to generate C++ header files with embedded binary data
https://github.com/ryanmcdermott/rules_cc_embed_data
Last synced: 3 months ago
JSON representation
Bazel rule to generate C++ header files with embedded binary data
- Host: GitHub
- URL: https://github.com/ryanmcdermott/rules_cc_embed_data
- Owner: ryanmcdermott
- License: mit
- Created: 2023-08-21T00:19:47.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-24T05:07:52.000Z (over 2 years ago)
- Last Synced: 2024-10-21T21:09:43.429Z (over 1 year ago)
- Language: Starlark
- Homepage:
- Size: 72.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rules_cc_embed_data
Bazel rule to generate C++ header files with embedded binary data.
## Pre-Requisites
* Bazel 6.0.0 or higher.
* C++ Compiler.
* Linux. _This rule has not been tested on other operating systems._
## Usage
### Workspace
```
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_cc_embed_data",
strip_prefix = "rules_cc_embed_data-0.1.0",
urls = ["https://github.com/ryanmcdermott/rules_cc_embed_data/archive/refs/tags/0.1.0.tar.gz"],
)
```
### BUILD file
```
load("@rules_cc_embed_data/cc_embed_data:defs.bzl", "embed_data")
embed_data(
name = "example_texts",
srcs = ["example1.txt", "example2.txt"],
visibility = ["//visibility:public"],
)
```
## Example
See `examples` directory in this repo.