mirror of
https://github.com/logos-storage/nim-bearssl.git
synced 2026-01-03 14:03:12 +00:00
* split `decls.nim` into smaller modules - allows using parts of the ABI without compiling all of `bearssl` * deprecate functions with `Br` prefix - there are duplicate exports both with and without `Br` for the same function and we use both in consumers like `chronos` and `libp2p` * fix several cases of incorrectly mapped types * use `var` for certain arguments that can't be `nil` * add script to regenerate ABI with `c2nim` * consistently use `uint` for length (`int` was sometimes used) The Split likely needs more cleanup work - this is a first cut to get the idea in place. In the new layout, `bearssl/abi/` contains "raw" nim mappings while hand-written helpers are in `bearssl/`.
28 lines
822 B
Nim
28 lines
822 B
Nim
import os, strutils
|
|
|
|
# Package
|
|
version = "0.1.5"
|
|
author = "Status Research & Development GmbH"
|
|
description = "BearSSL wrapper"
|
|
license = "MIT or Apache License 2.0"
|
|
mode = ScriptMode.Verbose
|
|
|
|
# Dependencies
|
|
requires "nim >= 1.2.0",
|
|
"unittest2"
|
|
|
|
### Helper functions
|
|
proc test(env, path: string) =
|
|
# Compilation language is controlled by TEST_LANG
|
|
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") & " " & env &
|
|
" -d:bearsslSplitAbi -rf --hints:off --skipParentCfg --styleCheck:usages --styleCheck:error " & path
|
|
|
|
task test, "Run tests":
|
|
for path in listFiles(thisDir() / "tests"):
|
|
if path.split(".")[^1] != "nim":
|
|
continue
|
|
test "-d:debug", path
|
|
test "-d:release", path
|
|
test "--gc:arc -d:release", path
|
|
rmFile(path[0..^5].toExe())
|