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