Skip to content

Commit

Permalink
Add instructions for building Go package into C static library
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed Oct 29, 2023
1 parent 1e8a039 commit cf7788f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions godot_cgo.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ func DesyncUntar(storeUrl *C.char, indexUrl *C.char, outputDir *C.char, cacheDir
func main() {}
```

You can build this Go package into a C static library with the following command:

```go
go build -o desync_c_interface.a -buildmode=c-archive .
```

## Using the Updated Static Library in C Program

You can then call this function from your C program like this:
Expand Down

0 comments on commit cf7788f

Please sign in to comment.