cgo

Crates.iocgo
lib.rscgo
version0.3.0
sourcesrc
created_at2023-06-06 05:04:40.492361
updated_at2023-06-20 05:34:58.720868
descriptionA library for build scripts to compile custom Go code
homepage
repositoryhttps://github.com/ryanfowler/cgo-rs
max_upload_size
id883529
size18,489
Ryan Fowler (ryanfowler)

documentation

https://docs.rs/cgo

README

cgo-rs

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");
}
Commit count: 29

cargo fmt