Add build script to build using Cargo.

This commit is contained in:
Jesse Brault 2024-11-22 17:48:52 -06:00
parent e0287c4fce
commit 40b27e3b80
3 changed files with 28 additions and 0 deletions

18
Cargo.lock generated
View File

@ -2,6 +2,24 @@
# It is not intended for manual editing.
version = 3
[[package]]
name = "cc"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47"
dependencies = [
"shlex",
]
[[package]]
name = "first-rust"
version = "0.1.0"
dependencies = [
"cc",
]
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"

View File

@ -4,3 +4,6 @@ version = "0.1.0"
edition = "2021"
[dependencies]
[build-dependencies]
cc = '1.2.1'

7
build.rs Normal file
View File

@ -0,0 +1,7 @@
fn main() {
// Tell Cargo to rerun if the c file is changed
println!("cargo:rerun-if-changed=src/test.c");
cc::Build::new()
.file("src/test.c")
.compile("test");
}