nim-ffi/ffi.nimble

35 lines
1.2 KiB
Plaintext
Raw Normal View History

2025-08-09 22:56:44 +02:00
# ffi.nimble
version = "0.1.3"
2025-08-09 22:56:44 +02:00
author = "Institute of Free Technology"
description = "FFI framework with custom header generation"
license = "MIT or Apache License 2.0"
packageName = "ffi"
requires "nim >= 2.2.4"
2026-01-07 00:01:17 +05:30
requires "chronos"
requires "chronicles"
requires "taskpools"
2025-08-09 22:56:44 +02:00
const nimFlagsOrc = "--mm:orc -d:chronicles_log_level=WARN"
const nimFlagsRefc = "--mm:refc -d:chronicles_log_level=WARN"
2026-04-29 23:48:36 +02:00
task buildffi, "Compile the library":
exec "nim c " & nimFlagsOrc & " --app:lib --noMain ffi.nim"
task test, "Run all tests under --mm:orc and --mm:refc":
for flags in [nimFlagsOrc, nimFlagsRefc]:
exec "nim c -r " & flags & " tests/test_alloc.nim"
exec "nim c -r " & flags & " tests/test_ffi_context.nim"
exec "nim c -r " & flags & " tests/test_gc_compat.nim"
task test_alloc, "Run alloc unit tests under --mm:orc and --mm:refc":
exec "nim c -r " & nimFlagsOrc & " tests/test_alloc.nim"
exec "nim c -r " & nimFlagsRefc & " tests/test_alloc.nim"
task test_ffi, "Run FFI context integration tests under --mm:orc and --mm:refc":
exec "nim c -r " & nimFlagsOrc & " tests/test_ffi_context.nim"
exec "nim c -r " & nimFlagsRefc & " tests/test_ffi_context.nim"