Skip to content

Commit 0f4c3be

Browse files
committed
Use cargo:include
1 parent 37565bc commit 0f4c3be

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
- run: rm openbsd-src/sys/sys/sysctl.h
4343
- run: rm openbsd-src/lib/libc/stdlib/malloc.c
4444

45+
- run: mv openbsd-src/sys/* include
46+
- run: mv openbsd-src/include/* include
47+
4548
- run: rm code.tar.gz
4649
- run: cargo build --target wasm32-unknown-unknown
4750

@@ -70,6 +73,9 @@ jobs:
7073
- run: rm openbsd-src/sys/sys/sysctl.h
7174
- run: rm openbsd-src/lib/libc/stdlib/malloc.c
7275

76+
- run: mv openbsd-src/sys/* include
77+
- run: mv openbsd-src/include/* include
78+
7379
- run: rm code.tar.gz
7480

7581
- run: cargo publish --allow-dirty --token ${{ secrets.CARGO_TOKEN }}

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
[package]
22
description = "The parts of OpenBSD libc that make sense on wasm32-unknown-unknown."
33
edition = "2018"
4+
keywords = ["libc", "wasm32-unknown-unknown"]
45
license = "BSD-3-Clause AND ISC AND MIT"
6+
links = "wasm32-unknown-unknown-openbsd-libc"
57
name = "wasm32-unknown-unknown-openbsd-libc"
68
repository = "https://github.com/trevyn/wasm32-unknown-unknown-openbsd-libc"
79
version = "0.1.0"

build.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ fn main() {
2626
"stdlib/heapsort.c",
2727
"stdlib/qsort.c",
2828
"string/bcmp.c",
29-
"string/bcmp.c",
30-
"string/bcmp.c",
3129
"string/bcopy.c",
3230
"string/bzero.c",
3331
"string/explicit_bzero.c",
@@ -84,11 +82,14 @@ fn main() {
8482
.collect::<Vec<_>>();
8583

8684
cc::Build::new()
87-
.include("openbsd-src/sys")
88-
.include("openbsd-src/include")
8985
.include("include")
9086
.files(sources)
9187
.file("src/errno.c")
9288
.flag("-w")
9389
.compile("wasm32-unknown-unknown-openbsd-libc");
90+
91+
println!(
92+
"cargo:include={}/include",
93+
env::var("CARGO_MANIFEST_DIR").unwrap()
94+
);
9495
}

src/lib.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
pub fn includes() -> Vec<impl AsRef<std::path::Path>> {
2-
let dir = env!("CARGO_MANIFEST_DIR");
3-
vec![
4-
format!("{}/openbsd-src/sys", dir),
5-
format!("{}/openbsd-src/include", dir),
6-
format!("{}/include", dir),
7-
]
8-
}
1+

0 commit comments

Comments
 (0)