Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
CMake: Build aleth-interpreter.so as a separated optional target
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Jun 29, 2018
1 parent a7498f3 commit 9c9c758
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 31 deletions.
24 changes: 2 additions & 22 deletions circle.yml
Expand Up @@ -46,7 +46,7 @@ defaults:
working_directory: ~/build
command: |
ETHEREUM_TEST_PATH=~/project/test/jsontests \
test/testeth -t GeneralStateTests -- --vm interpreter
test/testeth -t GeneralStateTests -- --vm libaleth-interpreter/libaleth-interpreter.so
store-package: &store-package
store_artifacts:
Expand Down Expand Up @@ -122,6 +122,7 @@ jobs:
- GENERATOR: Ninja
- BUILD_PARALLEL_JOBS: 8
- TEST_PARALLEL_JOBS: 8
- CMAKE_OPTIONS: -DALETH_INTERPRETER_SHARED=ON
docker:
- image: ethereum/cpp-build-env:2
steps:
Expand Down Expand Up @@ -169,28 +170,8 @@ jobs:
- *save-deps-cache
- *store-package
- *test
- *test-evmc-interpreter
- *upload-coverage-data

linux-interpreter:
environment:
- BUILD_TYPE: Release
- CXX: g++-6
- CC: gcc-6
- GCOV: gcov-6
- GENERATOR: Ninja
- BUILD_PARALLEL_JOBS: 3
- TEST_PARALLEL_JOBS: 4
- CMAKE_OPTIONS: -DTOOLCHAIN=cxx11-pic -DALETH_INTERPRETER_SHARED=ON
docker:
- image: ethereum/cpp-build-env:2
steps:
- checkout
- *update-submodules
- *environment-info
- *configure
- *build

macos-xcode90:
environment:
- CXX: clang++
Expand Down Expand Up @@ -228,4 +209,3 @@ workflows:
- macos-xcode90
- linux-clang6
- linux-gcc6
- linux-interpreter
24 changes: 15 additions & 9 deletions libaleth-interpreter/CMakeLists.txt
Expand Up @@ -2,24 +2,30 @@
# Copyright 2018 Aleth Autors.
# Licensed under the GNU General Public License, Version 3. See the LICENSE file.

if(ALETH_INTERPRETER_SHARED)
set(library_type SHARED)
else()
set(library_type)
endif()

add_library(
aleth-interpreter
${library_type}
set(
sources
interpreter.h
VM.cpp
VM.h
VMCalls.cpp
VMConfig.h
VMOpt.cpp
)
add_library(aleth-interpreter STATIC ${sources})
target_link_libraries(aleth-interpreter PRIVATE devcore aleth-buildinfo evmc::evmc evmc::instructions)

if(ALETH_INTERPRETER_SHARED)
# Build aleth-interpreter additionally as a shared library to include it in the package
add_library(aleth-interpreter-shared SHARED ${sources})
target_link_libraries(aleth-interpreter-shared PRIVATE devcore aleth-buildinfo evmc::evmc evmc::instructions)
set_target_properties(aleth-interpreter-shared PROPERTIES OUTPUT_NAME aleth-interpreter)
install(TARGETS aleth-interpreter-shared EXPORT alethTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
target_compile_options(aleth-interpreter PRIVATE -fstack-usage)
endif()

0 comments on commit 9c9c758

Please sign in to comment.