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

#572 in Build Utils

Download history 6/week @ 2023-12-25 5/week @ 2024-01-01 110/week @ 2024-01-08 7/week @ 2024-01-15 37/week @ 2024-01-29 19/week @ 2024-02-05 43/week @ 2024-02-12 38/week @ 2024-02-19 15/week @ 2024-02-26 24/week @ 2024-03-04 52/week @ 2024-03-11 76/week @ 2024-03-18 68/week @ 2024-03-25

221 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

~170KB