Expand description
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 = "*"
§Examples
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");
}
Structs§
- Build
- A builder for the compilation of a Go library.
- Error
- Represents an internal error that occurred, including an explanation.
Enums§
- Build
Mode - BuildMode to be used during compilation.
- Module
Mode - ModuleMode to be used during compilation.