Skip to content

Commit

Permalink
Merge pull request #6 from xypwn/main
Browse files Browse the repository at this point in the history
ryegen-init: build tags optional and non-default; ryegen: rework ryegen.Run, better names for native types, remove rye names for types, timing stats, simpler naming conflict resolution
  • Loading branch information
refaktor authored Sep 24, 2024
2 parents 6a8cc80 + d69dde7 commit e31f8c3
Show file tree
Hide file tree
Showing 12 changed files with 656 additions and 568 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@

.DS_Store

cmd/ryegen-init/ryegen-init
cmd/ryegen-init/ryegen-init.exe
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,43 @@ Optional: Edit "bindings.txt" to exclude specific functions from your bindings.

Re-run `go generate ./...` after making any configuration changes.

Compile the Rye interpreter with bindings (replace "b_fyne" with "b_*<your Go library's module name>*")
Build the Rye interpreter with bindings
```bash
go build
```

## Adding another binding / managing bindings with build tags

Rename your `ryegen` directory (originally generated by ryegen-init)
```bash
mv ryegen ryegen_fyne
```

Re-run ryegen-init with new Go library (use the -name flag to specify a directory name)
```bash
go run github.com/refaktor/ryegen/cmd/ryegen-init@main github.com/hajimehoshi/ebiten -name="ryegen_ebitengine"
```

In both generator directories (e.g. `ryegen_fyne` and `ryegen_ebitengine`), edit the `config.toml` and by uncommenting and changing the `build-flag` property

`ryegen_fyne/config.toml:`
```toml
#...
build-flag = "b_fyne"
#...
```

go build -tags b_fyne
`ryegen_ebitengine/config.toml:`
```toml
#...
build-flag = "b_ebitengine"
#...
```

Compile the Rye interpreter with bindings
```bash
# Bind both libraries
go build -tags "b_fyne b_ebitengine"
# Bind only fyne
go build -tags "b_fyne"
```
Loading

0 comments on commit e31f8c3

Please sign in to comment.