Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Brotlic (or BrotliC) is a thin wrapper around [brotli](https://github.com/google

A __C__ compiler is required for building [brotli](https://github.com/google/brotli) with cargo.

When building from a git checkout, initialize the bundled Brotli C submodule first:

```sh
git submodule update --init --recursive
```

## Usage

Brotlic provides Rust bindings to all compression and decompression APIs. On the fly compression and
Expand Down
8 changes: 8 additions & 0 deletions brotlic-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ use std::path::PathBuf;
fn main() {
let manifest_dir = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
let include_dir = manifest_dir.join("brotli/c/include");
let required_source = manifest_dir.join("brotli/c/common/constants.c");

if !required_source.exists() {
panic!(
"missing Brotli C sources at {}. If building from a git checkout, run `git submodule update --init --recursive` first.",
required_source.display()
);
}

cc::Build::new()
.files(&[
Expand Down