Skip to content

Commit

Permalink
examples: Move example_vm into the examples/example_vm subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Jul 23, 2019
1 parent b8ae6d2 commit be56b09
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bindings/go/evmc/evmc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 2 additions & 20 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion examples/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

#include "example_host.h"
#include "example_vm.h"
#include "example_vm/example_vm.h"

#include <evmc/helpers.h>

Expand Down
20 changes: 20 additions & 0 deletions examples/example_vm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/unittests/test_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit be56b09

Please sign in to comment.