2024-01-19 14:29:03 -06:00
|
|
|
|
|
|
|
|
import std/os
|
|
|
|
|
import std/strutils
|
|
|
|
|
import std/macros
|
|
|
|
|
|
|
|
|
|
const
|
|
|
|
|
currentDir = currentSourcePath().parentDir()
|
|
|
|
|
libDir* = currentDir/"vendor/circom-compat-ffi/target"/"release"
|
|
|
|
|
libPath* = libDir/"libcircom_compat_ffi.a"
|
|
|
|
|
|
|
|
|
|
static:
|
|
|
|
|
let cmd = "cd vendor/circom-compat-ffi && cargo build --release"
|
|
|
|
|
warning "\nBuilding circom compat ffi: " & cmd
|
|
|
|
|
let (output, exitCode) = gorgeEx cmd
|
|
|
|
|
for ln in output.splitLines():
|
|
|
|
|
warning("cargo> " & ln)
|
|
|
|
|
if exitCode != 0:
|
|
|
|
|
raiseAssert("Failed to build circom-compat-ffi")
|
|
|
|
|
|
2024-01-19 15:43:55 -06:00
|
|
|
{.passl: "-lcircom_compat_ffi -lm" & " -L" & libDir.}
|
2024-01-19 14:29:03 -06:00
|
|
|
|
|
|
|
|
include circomcompatffi
|