Skip to content

Commit 4a7efd8

Browse files
committed
Compile C code into Rust library.
1 parent fb938d4 commit 4a7efd8

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

Cargo.lock

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

memapi/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ features = ["ffi"]
2424
[dev-dependencies]
2525
proptest = "0.9.5"
2626

27+
[build-dependencies]
28+
cc = "1.0"
29+
2730
[lib]
2831
name = "pymemprofile_api"
2932
crate_type = ["cdylib"]

memapi/build.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
use cc;
2+
3+
fn main() {
4+
cc::Build::new()
5+
.file("src/filpreload.c")
6+
.warnings_into_errors(true)
7+
.flag("-std=c11")
8+
.flag("-Wall")
9+
.flag("-Werror=format-security")
10+
.flag("-Werror=implicit-function-declaration")
11+
.compile("filpreload");
12+
println!("cargo:rerun-if-changed=src/filpreload.c");
13+
}
File renamed without changes.

0 commit comments

Comments
 (0)