Merge pull request #362 from ethereum/move-example-vm

examples: Move example_vm into the examples/example_vm subdirectory
This commit is contained in:
Alex Beregszaszi 2019-07-23 12:42:16 +01:00 committed by GitHub
commit 83d2acffa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 35 additions and 25 deletions

View File

@ -102,7 +102,7 @@ WARN_LOGFILE =
INPUT = \
include/evmc/ \
docs/ \
examples/example_vm.c
examples/example_vm/example_vm.c
INPUT_ENCODING = UTF-8
FILE_PATTERNS =
RECURSIVE = NO

View File

@ -2,7 +2,7 @@
// Copyright 2018-2019 The EVMC Authors.
// Licensed under the Apache License, Version 2.0.
//go:generate gcc -shared ../../../examples/example_vm.c -I../../../include -o example_vm.so
//go:generate gcc -shared ../../../examples/example_vm/example_vm.c -I../../../include -o example_vm.so
package evmc

View File

@ -10,29 +10,11 @@ if(NOT CMAKE_CXX_STANDARD)
endif()
set(CMAKE_DEBUG_POSTFIX "")
add_subdirectory(example_vm)
add_subdirectory(example_precompiles_vm)
add_library(evmc-example-host STATIC example_host.cpp)
target_link_libraries(evmc-example-host PRIVATE evmc)
add_library(evmc-example-vm SHARED example_vm.c)
target_link_libraries(evmc-example-vm PRIVATE evmc)
add_library(evmc-example-vm-static STATIC example_vm.c)
target_link_libraries(evmc-example-vm-static PRIVATE evmc)
set_source_files_properties(example_vm.c PROPERTIES COMPILE_DEFINITIONS PROJECT_VERSION="${PROJECT_VERSION}")
add_executable(evmc-example example.c)
target_link_libraries(evmc-example PRIVATE evmc-example-host evmc-example-vm evmc)
if(EVMC_INSTALL)
install(TARGETS evmc-example-vm
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
endif()
target_link_libraries(evmc-example PRIVATE evmc-example-host evmc-example-vm-static evmc)

View File

@ -4,7 +4,7 @@
*/
#include "example_host.h"
#include "example_vm.h"
#include "example_vm/example_vm.h"
#include <evmc/helpers.h>

View File

@ -6,3 +6,11 @@ add_library(evmc-example-precompiles-vm SHARED example_precompiles_vm.cpp)
target_link_libraries(evmc-example-precompiles-vm PRIVATE evmc)
set_source_files_properties(example_precompiles_vm.cpp PROPERTIES
COMPILE_DEFINITIONS PROJECT_VERSION="${PROJECT_VERSION}")
if(EVMC_INSTALL)
install(TARGETS evmc-example-precompiles-vm
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
endif()

View File

@ -0,0 +1,20 @@
# EVMC: Ethereum Client-VM Connector API.
# Copyright 2019 The EVMC Authors.
# Licensed under the Apache License, Version 2.0.
add_library(evmc-example-vm SHARED example_vm.c)
target_link_libraries(evmc-example-vm PRIVATE evmc)
add_library(evmc-example-vm-static STATIC example_vm.c)
target_link_libraries(evmc-example-vm-static PRIVATE evmc)
set_source_files_properties(example_vm.cpp PROPERTIES
COMPILE_DEFINITIONS PROJECT_VERSION="${PROJECT_VERSION}")
if(EVMC_INSTALL)
install(TARGETS evmc-example-vm
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
endif()

View File

@ -7,7 +7,7 @@
#include <vector>
#include "../../examples/example_host.h"
#include "../../examples/example_vm.h"
#include "../../examples/example_vm/example_vm.h"
#include <evmc/evmc.hpp>
#include <evmc/helpers.hpp>