Skip to content

Commit

Permalink
fix: Compile woff2 and ots_glue in cpp mode
Browse files Browse the repository at this point in the history
`woff2` and `ots_glue` are C++ projects, so they should be compiled in C++ mode.
Also, explicitly annotate lz4 and brotli as `.cpp(false)`,
since they are pure C projects.
  • Loading branch information
jschwe committed Mar 22, 2024
1 parent cf5d003 commit 925c3d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const ZLIB_INCLUDE_DIR: &str = "src/fake-zlib";

fn build_lz4() {
cc::Build::new()
.cpp(false)
.file("src/deps/lz4/lib/lz4.c")
.compile("lz4");
}
Expand Down Expand Up @@ -38,6 +39,7 @@ fn build_brotli() {
.expect("vendored brotli sources not found");

cc::Build::new()
.cpp(false)
.files(brotli_sources)
.include(BROTLI_INCLUDE_DIR)
.compile("brotli");
Expand All @@ -55,6 +57,7 @@ fn build_woff2() {
let woff2_sources = file_names.iter().map(|name| woff2_dir.join(name));

cc::Build::new()
.cpp(true)
.files(woff2_sources)
.include(WOFF2_INCLUDE_DIR)
.include(BROTLI_INCLUDE_DIR)
Expand All @@ -65,6 +68,7 @@ fn build_woff2() {

fn build_ots_glue() {
cc::Build::new()
.cpp(true)
.file("src/ots_glue.cc")
.include(OTS_INCLUDE_DIR)
.std("c++11")
Expand Down

0 comments on commit 925c3d2

Please sign in to comment.