Skip to content

Commit

Permalink
CMake: Flatten examplevm
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Aug 30, 2018
1 parent 79048b6 commit d697018
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 24 deletions.
16 changes: 15 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)
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 "examplevm/examplevm.h"
#include "examplevm.h"

#include <evmc/helpers.h>

Expand Down
File renamed without changes.
File renamed without changes.
22 changes: 0 additions & 22 deletions examples/examplevm/CMakeLists.txt

This file was deleted.

0 comments on commit d697018

Please sign in to comment.