gobuild

Crates.iogobuild
lib.rsgobuild
version0.1.0-alpha.2
sourcesrc
created_at2020-04-10 16:45:56.724158
updated_at2020-04-12 20:21:24.430882
descriptionA build-time dependency for Cargo build scripts to invoke the go compiler to compile go code into a static archive/dynamic library to be linked into Rust code.
homepagehttps://github.com/myagley/gobuild
repositoryhttps://github.com/myagley/gobuild
max_upload_size
id228393
size18,891
Mike Yagley (myagley)

documentation

https://docs.rs/gobuild

README

gobuild

A library to compile go code into a Rust library/application. This library takes inspiration from the cc crate.

Using gobuild

First, you'll want to both add a build script for your crate (build.rs) and also add this crate to your Cargo.toml via:

[build-dependencies]
gobuild = "0.1.0-alpha.1"

Next, update the build.rs to something like:

// build.rs

fn main() {
    gobuild::Build::new()
        .file("hello.go")
        .compile("hello");
}

This will produce a libhello.h and libhello.a in OUT_DIR.

Commit count: 10

cargo fmt