4 releases (2 breaking)

0.3.0 Jun 20, 2023
0.2.1 Jun 17, 2023
0.2.0 Jun 7, 2023
0.1.0 Jun 6, 2023

#449 in Build Utils

Download history 60/week @ 2024-03-14 82/week @ 2024-03-21 31/week @ 2024-03-28 25/week @ 2024-04-04 71/week @ 2024-04-11 54/week @ 2024-04-18 96/week @ 2024-04-25 52/week @ 2024-05-02 47/week @ 2024-05-09 85/week @ 2024-05-16 35/week @ 2024-05-23 50/week @ 2024-05-30 77/week @ 2024-06-06 62/week @ 2024-06-13 22/week @ 2024-06-20 7/week @ 2024-06-27

174 downloads per month
Used in metafmt

MIT license

16KB
291 lines

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

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

Dependencies

~180KB