CMake: Flatten examplevm

This commit is contained in:
Paweł Bylica 2018-08-30 18:19:26 +02:00
parent f858f79e2a
commit 0bb3a67284
No known key found for this signature in database
GPG Key ID: 7A0C037434FE77EF
5 changed files with 16 additions and 24 deletions

View File

@ -2,16 +2,30 @@
# Copyright 2018 The EVMC Authors.
# Licensed under the Apache License, Version 2.0. See the LICENSE file.
include(GNUInstallDirs)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
set(CMAKE_DEBUG_POSTFIX "")
add_library(evmc-example-host STATIC example_host.cpp)
target_link_libraries(evmc-example-host PRIVATE evmc)
add_subdirectory(examplevm)
add_library(evmc-examplevm examplevm.c)
target_link_libraries(evmc-examplevm PRIVATE evmc)
set_source_files_properties(examplevm.c PROPERTIES COMPILE_DEFINITIONS PROJECT_VERSION=${PROJECT_VERSION})
add_executable(evmc-example example.c)
target_link_libraries(evmc-example PRIVATE evmc-example-host evmc-examplevm evmc)
install(TARGETS evmc-examplevm
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View File

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

View File

@ -1,22 +0,0 @@
# EVMC: Ethereum Client-VM Connector API
# Copyright 2018 The EVMC Authors.
# Licensed under the Apache License, Version 2.0. See the LICENSE file.
include(GNUInstallDirs)
add_library(evmc-examplevm examplevm.c)
target_link_libraries(evmc-examplevm PRIVATE evmc)
set_target_properties(
evmc-examplevm PROPERTIES
DEBUG_POSTFIX ""
RUNTIME_OUTPUT_DIRECTORY ..
LIBRARY_OUTPUT_DIRECTORY ..
)
set_source_files_properties(examplevm.c PROPERTIES COMPILE_DEFINITIONS PROJECT_VERSION=${PROJECT_VERSION})
install(
TARGETS evmc-examplevm
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)