From e6e8a344751490d22563e2e320a4d7bd693ee0b3 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Mon, 8 Nov 2021 02:07:42 -0600 Subject: [PATCH 1/3] docs + fail if not arc --- README.md | 2 ++ src/genny/internal.nim | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 59d4af2..d3e611d 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/src/genny/internal.nim b/src/genny/internal.nim index c1786b9..5080d8b 100644 --- a/src/genny/internal.nim +++ b/src/genny/internal.nim @@ -242,8 +242,14 @@ proc generateSeqs(sym: NimNode) = proc exportSeqInternal*(sym: NimNode) = generateSeqs(sym) +const header = """ +when not defined(gcArc): + {.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)) ) From b86e72e20f50e78073ceaa0c1c04155ee01809ac Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Mon, 8 Nov 2021 02:29:41 -0600 Subject: [PATCH 2/3] f --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1052ef0..0c9b349 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 From 7853df3b9b6cd96ffbb0f3f5e03356b26222ed04 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Mon, 8 Nov 2021 02:31:12 -0600 Subject: [PATCH 3/3] f --- src/genny/internal.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/genny/internal.nim b/src/genny/internal.nim index 5080d8b..e9fb601 100644 --- a/src/genny/internal.nim +++ b/src/genny/internal.nim @@ -243,7 +243,7 @@ proc exportSeqInternal*(sym: NimNode) = generateSeqs(sym) const header = """ -when not defined(gcArc): +when not defined(gcArc) and not defined(gcOrc): {.error: "Please use --gc:arc or --gc:orc when using Genny.".} """