From 59d7ba1f1e93c0220effc0cc31ab459a1cde464c Mon Sep 17 00:00:00 2001 From: Jordan Hrycaj Date: Wed, 21 Apr 2021 11:15:06 +0100 Subject: [PATCH] print compiler warning about the VM used why: handy to have confirmation about which of the three different VMs is activated --- nimbus/nimbus.nim | 3 +++ nimbus/vm_compile_info.nim | 20 ++++++++++++++++++++ tests/all_tests.nim | 1 + 3 files changed, 24 insertions(+) create mode 100644 nimbus/vm_compile_info.nim diff --git a/nimbus/nimbus.nim b/nimbus/nimbus.nim index 83d867a3f..f76c8e3a0 100644 --- a/nimbus/nimbus.nim +++ b/nimbus/nimbus.nim @@ -7,6 +7,9 @@ # This file may not be copied, modified, or distributed except according to # those terms. +import + ../nimbus/vm_compile_info + import os, strutils, net, options, eth/keys, db/[storage_types, db_chain, select_backend], diff --git a/nimbus/vm_compile_info.nim b/nimbus/vm_compile_info.nim new file mode 100644 index 000000000..85a5a6937 --- /dev/null +++ b/nimbus/vm_compile_info.nim @@ -0,0 +1,20 @@ +# Nimbus +# Copyright (c) 2018 Status Research & Development GmbH +# Licensed under either of +# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or +# http://www.apache.org/licenses/LICENSE-2.0) +# * MIT license ([LICENSE-MIT](LICENSE-MIT) or +# http://opensource.org/licenses/MIT) +# at your option. This file may not be copied, modified, or distributed except +# according to those terms. + +when defined(evmc_enabled): + {.warning: "*** Compiling with EVMC enabled".} + +elif defined(vm2_enabled): + {.warning: "*** Compiling with VM2 enabled".} + +else: + {.warning: "*** Compiling with standard NIM VM enabled".} + +{.used.} diff --git a/tests/all_tests.nim b/tests/all_tests.nim index 7f2cb492e..584b23fa2 100644 --- a/tests/all_tests.nim +++ b/tests/all_tests.nim @@ -5,6 +5,7 @@ # * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) # at your option. This file may not be copied, modified, or distributed except according to those terms. +import ../nimbus/vm_compile_info import macros, strutils, os, unittest2, osproc import threadpool