Skip to content

A library to compile Go into a Rust library or application

License

Notifications You must be signed in to change notification settings

ryanfowler/cgo-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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");
}

About

A library to compile Go into a Rust library or application

Topics

Resources

License

Stars

Watchers

Forks