Skip to content

Commit 0879105

Browse files
committed
Generate possum.h as part of build
Needed to ensure C++ bindings aren't produced accidentally.
1 parent b0aa484 commit 0879105

File tree

4 files changed

+126
-12
lines changed

4 files changed

+126
-12
lines changed

Cargo.lock

Lines changed: 113 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ test-log = "0.2.14"
6868
[target.'cfg(loom)'.dev-dependencies]
6969
loom = "0.7"
7070

71+
[build-dependencies]
72+
cbindgen = "0.29.0"
73+
7174
[features]
7275
default = []
7376
testing = ["dep:fdlimit", "dep:rayon", "dep:twox-hash"]

build.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1+
use std::env;
2+
13
fn main() {
24
// We have a custom "loom" cfg that Rust warns about since 1.80.
35
println!("cargo::rustc-check-cfg=cfg(loom)");
6+
7+
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
8+
9+
cbindgen::generate(crate_dir)
10+
.expect("Unable to generate bindings")
11+
// I expect there's a better place to put this, then copy it into the Go
12+
// directory so it is packaged in the Go module.
13+
.write_to_file("go/cpossum/possum.h");
414
}

go/go.sum

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
github.com/RoaringBitmap/roaring v0.4.7/go.mod h1:8khRDP4HmeXns4xIj9oGrKSz7XTQiJx2zgh7AcNke4w=
2-
github.com/anacrolix/chansync v0.5.1-0.20240710235309-042fd9527a94 h1:oz2dp9sWY1iFOxFRZh7azX0O81K7Jwb885jQDmIIOWE=
3-
github.com/anacrolix/chansync v0.5.1-0.20240710235309-042fd9527a94/go.mod h1:DZsatdsdXxD0WiwcGl0nJVwyjCKMDv+knl1q2iBjA2k=
42
github.com/anacrolix/chansync v0.5.1 h1:j+R9DtotkXm40VFjZ8rJTSJkg2Gv1ldZt8kl96lyJJ0=
53
github.com/anacrolix/chansync v0.5.1/go.mod h1:DZsatdsdXxD0WiwcGl0nJVwyjCKMDv+knl1q2iBjA2k=
64
github.com/anacrolix/envpprof v0.0.0-20180404065416-323002cec2fa/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54gqtVn8yhP7c=
75
github.com/anacrolix/envpprof v1.0.0/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54gqtVn8yhP7c=
86
github.com/anacrolix/envpprof v1.1.0 h1:hz8QWMN1fA01YNQsUtVvl9hBXQWWMxSnHHoOK9IdrNY=
97
github.com/anacrolix/envpprof v1.1.0/go.mod h1:My7T5oSqVfEn4MD4Meczkw/f5lSIndGAKu/0SM/rkf4=
10-
github.com/anacrolix/generics v0.0.0-20230911070922-5dd7545c6b13 h1:qwOprPTDMM3BASJRf84mmZnTXRsPGGJ8xoHKQS7m3so=
11-
github.com/anacrolix/generics v0.0.0-20230911070922-5dd7545c6b13/go.mod h1:ff2rHB/joTV03aMSSn/AZNnaIpUw0h3njetGsaXcMy8=
12-
github.com/anacrolix/generics v0.0.1 h1:4WVhK6iLb3UAAAQP6I3uYlMOHcp9FqJC9j4n81Wv9Ks=
13-
github.com/anacrolix/generics v0.0.1/go.mod h1:ff2rHB/joTV03aMSSn/AZNnaIpUw0h3njetGsaXcMy8=
148
github.com/anacrolix/generics v0.0.2 h1:UbtD+KntUGxeGYMC4RwhsETieL9ixGdSptJQRhdy7No=
159
github.com/anacrolix/generics v0.0.2/go.mod h1:ff2rHB/joTV03aMSSn/AZNnaIpUw0h3njetGsaXcMy8=
1610
github.com/anacrolix/log v0.6.0 h1:5y+wtTWoecbrAWWuoBCH7UuGFiD6q2jnQxrLK01RC+Q=

0 commit comments

Comments
 (0)