Crates.io | cgo |
lib.rs | cgo |
version | 0.3.0 |
source | src |
created_at | 2023-06-06 05:04:40.492361 |
updated_at | 2023-06-20 05:34:58.720868 |
description | A library for build scripts to compile custom Go code |
homepage | |
repository | https://github.com/ryanfowler/cgo-rs |
max_upload_size | |
id | 883529 |
size | 18,489 |
A library for build scripts to compile custom Go code, inspired by the excellent cc crate.
It is intended that you use this library from within your build.rs
file by
adding the cgo crate to your build-dependencies
:
[build-dependencies]
cgo = "*"
The following example will statically compile the Go package and instruct
cargo to link the resulting library (libexample
).
fn main() {
cgo::Build::new()
.package("pkg/example/main.go")
.build("example");
}