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

Commit 9c9c758

Browse files
committed
CMake: Build aleth-interpreter.so as a separated optional target
1 parent a7498f3 commit 9c9c758

File tree

2 files changed

+17
-31
lines changed

2 files changed

+17
-31
lines changed

circle.yml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ defaults:
4646
working_directory: ~/build
4747
command: |
4848
ETHEREUM_TEST_PATH=~/project/test/jsontests \
49-
test/testeth -t GeneralStateTests -- --vm interpreter
49+
test/testeth -t GeneralStateTests -- --vm libaleth-interpreter/libaleth-interpreter.so
5050
5151
store-package: &store-package
5252
store_artifacts:
@@ -122,6 +122,7 @@ jobs:
122122
- GENERATOR: Ninja
123123
- BUILD_PARALLEL_JOBS: 8
124124
- TEST_PARALLEL_JOBS: 8
125+
- CMAKE_OPTIONS: -DALETH_INTERPRETER_SHARED=ON
125126
docker:
126127
- image: ethereum/cpp-build-env:2
127128
steps:
@@ -169,28 +170,8 @@ jobs:
169170
- *save-deps-cache
170171
- *store-package
171172
- *test
172-
- *test-evmc-interpreter
173173
- *upload-coverage-data
174174

175-
linux-interpreter:
176-
environment:
177-
- BUILD_TYPE: Release
178-
- CXX: g++-6
179-
- CC: gcc-6
180-
- GCOV: gcov-6
181-
- GENERATOR: Ninja
182-
- BUILD_PARALLEL_JOBS: 3
183-
- TEST_PARALLEL_JOBS: 4
184-
- CMAKE_OPTIONS: -DTOOLCHAIN=cxx11-pic -DALETH_INTERPRETER_SHARED=ON
185-
docker:
186-
- image: ethereum/cpp-build-env:2
187-
steps:
188-
- checkout
189-
- *update-submodules
190-
- *environment-info
191-
- *configure
192-
- *build
193-
194175
macos-xcode90:
195176
environment:
196177
- CXX: clang++
@@ -228,4 +209,3 @@ workflows:
228209
- macos-xcode90
229210
- linux-clang6
230211
- linux-gcc6
231-
- linux-interpreter

libaleth-interpreter/CMakeLists.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,30 @@
22
# Copyright 2018 Aleth Autors.
33
# Licensed under the GNU General Public License, Version 3. See the LICENSE file.
44

5-
if(ALETH_INTERPRETER_SHARED)
6-
set(library_type SHARED)
7-
else()
8-
set(library_type)
9-
endif()
10-
11-
add_library(
12-
aleth-interpreter
13-
${library_type}
5+
set(
6+
sources
147
interpreter.h
158
VM.cpp
169
VM.h
1710
VMCalls.cpp
1811
VMConfig.h
1912
VMOpt.cpp
2013
)
14+
add_library(aleth-interpreter STATIC ${sources})
2115
target_link_libraries(aleth-interpreter PRIVATE devcore aleth-buildinfo evmc::evmc evmc::instructions)
2216

17+
if(ALETH_INTERPRETER_SHARED)
18+
# Build aleth-interpreter additionally as a shared library to include it in the package
19+
add_library(aleth-interpreter-shared SHARED ${sources})
20+
target_link_libraries(aleth-interpreter-shared PRIVATE devcore aleth-buildinfo evmc::evmc evmc::instructions)
21+
set_target_properties(aleth-interpreter-shared PROPERTIES OUTPUT_NAME aleth-interpreter)
22+
install(TARGETS aleth-interpreter-shared EXPORT alethTargets
23+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
24+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
25+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
26+
)
27+
endif()
28+
2329
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
2430
target_compile_options(aleth-interpreter PRIVATE -fstack-usage)
2531
endif()

0 commit comments

Comments
 (0)