Skip to content

Commit

Permalink
Merge pull request #34 from guzba/master
Browse files Browse the repository at this point in the history
docs + fail if not arc
  • Loading branch information
treeform authored Nov 8, 2021
2 parents 86d50ce + 7853df3 commit 0b9444a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: jiro4989/setup-nim-action@v1
- run: nimble test -y
- run: nimble test --gc:arc -y
- run: nimble test --gc:orc -y
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ So you made a cool Nim library but you want it to be available to other language

https://nimdocs.com/treeform/genny

See [Pixie's nimble file](https://github.com/treeform/pixie/blob/master/pixie.nimble#L16) for an example of how to compile bindings with `genny`.

## Installation:

`nimble install genny`
Expand Down
8 changes: 7 additions & 1 deletion src/genny/internal.nim
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,14 @@ proc generateSeqs(sym: NimNode) =
proc exportSeqInternal*(sym: NimNode) =
generateSeqs(sym)

const header = """
when not defined(gcArc) and not defined(gcOrc):
{.error: "Please use --gc:arc or --gc:orc when using Genny.".}
"""

proc writeInternal*(dir, lib: string) =
writeFile(
&"{dir}/internal.nim",
internal.replace("$Lib", lib).replace("$lib", toSnakeCase(lib))
header & internal.replace("$Lib", lib).replace("$lib", toSnakeCase(lib))
)

0 comments on commit 0b9444a

Please sign in to comment.