mirror of
https://github.com/status-im/evmc.git
synced 2025-02-22 07:58:19 +00:00
Nimble support
This commit is contained in:
parent
ad51a35021
commit
1eac158237
3
bindings/nim/.gitignore
vendored
3
bindings/nim/.gitignore
vendored
@ -4,3 +4,6 @@ nimcache/
|
||||
# Executables shall be put in an ignored build/ directory
|
||||
build/
|
||||
|
||||
# copied by `nimble install`
|
||||
/include
|
||||
|
||||
|
@ -6,11 +6,11 @@
|
||||
mode = ScriptMode.Verbose
|
||||
|
||||
packageName = "evmc"
|
||||
version = "0.0.2"
|
||||
version = "0.0.3"
|
||||
author = "Status Research & Development GmbH"
|
||||
description = "A wrapper for the The Ethereum EVMC library"
|
||||
license = "Apache License 2.0"
|
||||
skipDirs = @["tests"]
|
||||
installDirs = @["evmc", "include"]
|
||||
|
||||
requires "nim >= 0.19",
|
||||
"stew"
|
||||
@ -35,3 +35,10 @@ task test_release, "Run all tests - prod implementation":
|
||||
task test, "Run all tests - test and production implementation":
|
||||
exec "nimble test_debug"
|
||||
exec "nimble test_release"
|
||||
|
||||
proc copyUpstreamFiles() =
|
||||
cpDir("../../include", "include")
|
||||
|
||||
before install:
|
||||
copyUpstreamFiles()
|
||||
|
||||
|
@ -1,3 +1,10 @@
|
||||
import os
|
||||
|
||||
# when running from the Git repo
|
||||
{.passC: "-I" & currentSourcePath.parentDir().parentDir().parentDir().parentDir() / "include".}
|
||||
# when installed by Nimble
|
||||
{.passC: "-I" & currentSourcePath.parentDir().parentDir() / "include".}
|
||||
|
||||
type
|
||||
evmc_bytes32* {.importc: "evmc_bytes32", header: "evmc/evmc.h", bycopy.} = object
|
||||
bytes* {.importc: "bytes".}: array[32, uint8]
|
||||
|
7
bindings/nim/evmc/evmc.nim.header
Normal file
7
bindings/nim/evmc/evmc.nim.header
Normal file
@ -0,0 +1,7 @@
|
||||
import os
|
||||
|
||||
# when running from the Git repo
|
||||
{.passC: "-I" & currentSourcePath.parentDir().parentDir().parentDir().parentDir() / "include".}
|
||||
# when installed by Nimble
|
||||
{.passC: "-I" & currentSourcePath.parentDir().parentDir() / "include".}
|
||||
|
@ -52,6 +52,8 @@ END {
|
||||
for(i in consts)
|
||||
print consts[i]
|
||||
}
|
||||
' > evmc.nim
|
||||
rm tmp.nim
|
||||
' > evmc.nim.body
|
||||
|
||||
cat evmc.nim.header evmc.nim.body > evmc.nim
|
||||
rm tmp.nim evmc.nim.body
|
||||
|
||||
|
@ -3,14 +3,13 @@
|
||||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import os, unittest,
|
||||
import unittest,
|
||||
stew/byteutils,
|
||||
../evmc/evmc, ../evmc/evmc_nim, ./nim_host
|
||||
|
||||
{.compile: "../../../examples/example_host.cpp".}
|
||||
{.compile: "../../../examples/example_vm/example_vm.c".}
|
||||
|
||||
{.passC: "-I" & currentSourcePath.parentDir().parentDir().parentDir().parentDir() / "include".}
|
||||
when defined(posix):
|
||||
{.passC: "-std=c++11".}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user