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

#718 in Build Utils

Download history 47/week @ 2024-08-23 20/week @ 2024-08-30 60/week @ 2024-09-06 12/week @ 2024-09-13 59/week @ 2024-09-20 100/week @ 2024-09-27 49/week @ 2024-10-04 39/week @ 2024-10-11 99/week @ 2024-10-18 125/week @ 2024-10-25 90/week @ 2024-11-01 35/week @ 2024-11-08 25/week @ 2024-11-15 23/week @ 2024-11-22 41/week @ 2024-11-29 73/week @ 2024-12-06

171 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

~230–325KB