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

Commit df1949e

Browse files
committed
Merge branch 'develop' into evmc
# Conflicts: # appveyor.yml
2 parents 897b645 + c7d1cdc commit df1949e

File tree

156 files changed

+1896
-9316
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+1896
-9316
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,18 @@ eth_policy()
3636
# project name and version should be set after cmake_policy CMP0048
3737
project(cpp-ethereum VERSION "1.3.0")
3838

39+
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY On)
40+
41+
include(EthOptions)
3942
include(EthCompilerSettings)
4043
include(EthExecutableHelper)
4144
include(EthDependencies)
4245
include(EthUtils)
43-
include(EthOptions)
4446

4547
include(deps/jsoncpp.cmake)
4648
include(deps/jsonrpc.cmake)
4749
include(deps/cryptopp.cmake)
50+
include(deps/boost.cmake)
4851

4952
configure_project(CPUID CURL EVMJIT FATDB MINIUPNPC ROCKSDB PARANOID TESTS VMTRACE)
5053

appveyor.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ clone_script:
4545
git checkout -qf FETCH_HEAD
4646
git submodule -q update --init --recursive
4747
}
48-
cache: build/evmjit/llvm -> evmjit/cmake/llvm.cmake
48+
cache:
49+
- build/evmjit/llvm -> evmjit/cmake/llvm.cmake
50+
- deps/boost -> deps/boost.cmake
51+
- deps/tmp/boost -> deps/boost.cmake
4952
#RDP LOGIN details for trouble shooting
5053
#init:
5154
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

bench/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,6 @@ target_include_directories(bench PRIVATE ../utils)
99
target_link_libraries(bench ${Dev_DEVCORE_LIBRARIES})
1010
target_link_libraries(bench ${Dev_DEVCRYPTO_LIBRARIES})
1111

12-
if (MSVC)
13-
find_package(Boost QUIET REQUIRED COMPONENTS chrono date_time)
14-
target_link_libraries(bench ${Boost_CHRONO_LIBRARIES})
15-
target_link_libraries(bench ${Boost_DATE_TIME_LIBRARIES})
16-
endif()
17-
1812
if (UNIX AND NOT APPLE)
1913
target_link_libraries(bench pthread)
2014
endif()
21-
22-
if (APPLE)
23-
install(TARGETS bench DESTINATION bin)
24-
else()
25-
eth_install_executable(bench)
26-
endif()
27-

cmake/EthBuildInfo.cmake

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function(create_build_info NAME)
1+
function(create_build_info)
22

33
# Set build platform; to be written to BuildInfo.h
44
set(ETH_BUILD_OS "${CMAKE_SYSTEM_NAME}")
@@ -27,10 +27,6 @@ function(create_build_info NAME)
2727

2828
set(ETH_BUILD_PLATFORM "${ETH_BUILD_OS}/${ETH_BUILD_COMPILER}/${ETH_BUILD_JIT_MODE}")
2929

30-
if (PARANOID)
31-
set(ETH_BUILD_PLATFORM "${ETH_BUILD_PLATFORM}/PARA")
32-
endif ()
33-
3430
#cmake build type may be not speCified when using msvc
3531
if (CMAKE_BUILD_TYPE)
3632
set(_cmake_build_type ${CMAKE_BUILD_TYPE})
@@ -39,9 +35,9 @@ function(create_build_info NAME)
3935
endif()
4036

4137
# Generate header file containing useful build information
42-
add_custom_target(${NAME}_BuildInfo.h ALL
38+
add_custom_target(BuildInfo.h ALL
4339
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
44-
COMMAND ${CMAKE_COMMAND} -DETH_SOURCE_DIR="${PROJECT_SOURCE_DIR}" -DETH_BUILDINFO_IN="${ETH_CMAKE_DIR}/templates/BuildInfo.h.in" -DETH_DST_DIR="${PROJECT_BINARY_DIR}/include/${PROJECT_NAME}" -DETH_CMAKE_DIR="${ETH_CMAKE_DIR}"
40+
COMMAND ${CMAKE_COMMAND} -DETH_SOURCE_DIR="${PROJECT_SOURCE_DIR}" -DETH_BUILDINFO_IN="${ETH_CMAKE_DIR}/templates/BuildInfo.h.in" -DETH_DST_DIR="${PROJECT_BINARY_DIR}/include" -DETH_CMAKE_DIR="${ETH_CMAKE_DIR}"
4541
-DETH_BUILD_TYPE="${_cmake_build_type}"
4642
-DETH_BUILD_OS="${ETH_BUILD_OS}"
4743
-DETH_BUILD_COMPILER="${ETH_BUILD_COMPILER}"

cmake/EthCompilerSettings.cmake

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,6 @@ elseif (MSVC)
196196
# stack size 16MB
197197
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4099,4075 /STACK:16777216")
198198

199-
# windows likes static
200-
if (NOT ETH_STATIC)
201-
message("Forcing static linkage for MSVC.")
202-
set(ETH_STATIC 1)
203-
endif ()
204-
205199
# If you don't have GCC, Clang or VC++ then you are on your own. Good luck!
206200
else ()
207201
message(WARNING "Your compiler is not tested, if you run into any issues, we'd welcome any patches.")
@@ -240,9 +234,3 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
240234
endif ()
241235
endif ()
242236
endif ()
243-
244-
if(ETH_STATIC)
245-
set(BUILD_SHARED_LIBS OFF)
246-
else()
247-
set(BUILD_SHARED_LIBS ON)
248-
endif(ETH_STATIC)

cmake/EthDependencies.cmake

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ if (MSVC)
4949
set (CMAKE_PREFIX_PATH ${ETH_DEPENDENCY_INSTALL_DIR} ${CMAKE_PREFIX_PATH})
5050
endif()
5151

52-
# boilerplate macros for some code editors
53-
add_definitions(-DETH_TRUE)
54-
5552
# custom cmake scripts
5653
set(ETH_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
5754
set(ETH_SCRIPTS_DIR ${ETH_CMAKE_DIR}/scripts)
@@ -88,105 +85,13 @@ else()
8885
set(Boost_USE_STATIC_LIBS ON)
8986
endif()
9087

91-
# We have work-in-progress here to support building cpp-ethereum with static-linkage, which
92-
# provides a fantastic end-user experience. You have entirely standalone executables
93-
# which are entirely atomic and "just work". They contain everything you need and talk directly
94-
# to the operating system kernel. Such linkage also allow best-possible dead-code removal and
95-
# global optimizations. That is the model which is used by default for all golang apps.
96-
#
97-
# "Enable static build of binaries"
98-
# https://github.com/ethereum/webthree-umbrella/issues/495
99-
#
100-
# So we just have `geth` and `geth.exe`. This mode lets you have an `eth` which works just
101-
# the same. This approach is a particular benefit on Linux where there is huge fragmentation
102-
# of packaging systems and .so versioning across distros. Building a standalone executable
103-
# for Linux which "just works" on all distros would be a huge win. This mode allows just
104-
# that to happen already on Alpine Linux using the musl standard library, and I hope we can
105-
# extend that support to further distros in the near future.
106-
#
107-
# We also have partial support for static linkage on macOS, though we would only be able to
108-
# statically link the external dependencies above the kernel. Anything which is part of the
109-
# operating system itself can only be used via dylibs. Still, we can improve things a lot.
110-
#
111-
# This is a macOS operating system constraint.
112-
#
113-
# See https://developer.apple.com/library/mac/qa/qa1118/_index.html
114-
#
115-
# "Apple does not support statically linked binaries on Mac OS X. A statically linked binary
116-
# assumes binary compatibility at the kernel system call interface, and we do not make any
117-
# guarantees on that front. Rather, we strive to ensure binary compatibility in each
118-
# dynamically linked system library and framework."
119-
120-
set(STATIC_LINKING FALSE CACHE BOOL "Build static binaries")
121-
122-
if (STATIC_LINKING)
123-
124-
set(Boost_USE_STATIC_RUNTIME ON)
125-
set(OpenSSL_USE_STATIC_LIBS ON)
126-
127-
if (MSVC)
128-
# TODO - Why would we need .a on Windows? Maybe some Cygwin-ism.
129-
# When I work through Windows static linkage, I will remove this,
130-
# if that is possible.
131-
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
132-
elseif (APPLE)
133-
# At the time of writing, we are still only PARTIALLY statically linked
134-
# on OS X, with a mixture of statically linked external libraries where
135-
# those are available, and dynamically linked where that is the only
136-
# option we have. Ultimately, the aim would be for everything except
137-
# the runtime libraries to be statically linked.
138-
#
139-
# Still TODO:
140-
# - json-rpc-cpp
141-
# - leveldb (which pulls in snappy, for the dylib at ;east)
142-
# - miniupnp
143-
# - gmp
144-
#
145-
# Two further libraries (curl and zlib) ship as dylibs with the platform
146-
# but again we could build from source and statically link these too.
147-
set(CMAKE_FIND_LIBRARY_SUFFIXES .a .dylib)
148-
else()
149-
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
150-
endif()
151-
152-
set(ETH_STATIC ON)
153-
endif()
154-
155-
# Add Homebrew include paths and library paths for macOS clients.
156-
#
157-
# Homebrew (http://brew.sh/) is the de-facto standard package manager for Mac.
158-
# It is a rolling-release manager, which brings its own problems, because it
159-
# means that we are building on top of an unstable platform, where the build
160-
# can work for me today and be broken for you tomorrow, even though we didn't
161-
# change anything ourselves. Qt was particularly problematic for this, but
162-
# thankfully is no longer an issue for us anymore, after we removed the GUI
163-
# applications in cpp-ethereum-v1.3.0.
164-
#
165-
# There is an alternative (minority) packaging system called MacPorts, but it isn't
166-
# possible to run both on a single computer, so we dropped support for
167-
# MacPorts in early 2016 to simplify our problem space.
168-
#
169-
# Again, as per the Windows notes above, building dependencies from source
170-
# would sidestep these issues entirely.
171-
#
172-
# "Both Homebrew and MacPorts are 'rolling release' package managers"
173-
# https://github.com/ethereum/webthree-umbrella/issues/118
174-
if (APPLE)
175-
link_directories(/usr/local/lib)
176-
include_directories(/usr/local/include)
177-
endif()
178-
17988
include_directories(BEFORE "${PROJECT_BINARY_DIR}/include")
18089

18190
function(eth_use TARGET REQUIRED)
18291
if (NOT TARGET ${TARGET})
18392
message(FATAL_ERROR "eth_use called for non existing target ${TARGET}")
18493
endif()
18594

186-
if (TARGET ${PROJECT_NAME}_BuildInfo.h)
187-
add_dependencies(${TARGET} ${PROJECT_NAME}_BuildInfo.h)
188-
endif()
189-
19095
foreach(MODULE ${ARGN})
19196
string(REPLACE "::" ";" MODULE_PARTS "${MODULE}")
19297
list(GET MODULE_PARTS 0 MODULE_MAIN)

cmake/EthExecutableHelper.cmake

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -43,36 +43,6 @@ macro(eth_add_executable EXECUTABLE)
4343

4444
endmacro()
4545

46-
macro(eth_simple_add_executable EXECUTABLE)
47-
add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS})
48-
49-
# Apple does not support statically linked binaries on OS X. That means
50-
# that we can only statically link against our external libraries, but
51-
# we cannot statically link against the C++ runtime libraries and other
52-
# platform libraries (as is possible on Windows and Alpine Linux) to produce
53-
# an entirely transportable binary.
54-
#
55-
# See https://developer.apple.com/library/mac/qa/qa1118/_index.html for more info.
56-
#
57-
# GLIBC also appears not to support static linkage too, which probably means that
58-
# Debian and Ubuntu will only be able to do partially-statically linked
59-
# executables too, just like OS X.
60-
#
61-
# For OS X, at the time of writing, we are left with the following dynamically
62-
# linked dependencies, of which curl and libz might still be fixable:
63-
#
64-
# /usr/lib/libc++.1.dylib
65-
# /usr/lib/libSystem.B.dylib
66-
# /usr/lib/libcurl.4.dylib
67-
# /usr/lib/libz.1.dylib
68-
#
69-
if (STATIC_LINKING AND NOT APPLE)
70-
set(CMAKE_EXE_LINKER_FLAGS "-static ${CMAKE_EXE_LINKER_FLAGS}")
71-
set_target_properties(${EXECUTABLE} PROPERTIES LINK_SEARCH_START_STATIC 1)
72-
set_target_properties(${EXECUTABLE} PROPERTIES LINK_SEARCH_END_STATIC 1)
73-
endif()
74-
endmacro()
75-
7646
macro(eth_copy_dll EXECUTABLE DLL)
7747
# dlls must be unsubstitud list variable (without ${}) in format
7848
# optimized;path_to_dll.dll;debug;path_to_dlld.dll

cmake/EthOptions.cmake

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ macro(configure_project)
77
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
88
endif()
99

10-
eth_default_option(STATIC_BUILD OFF)
10+
eth_default_option(BUILD_SHARED_LIBS OFF)
1111

1212
# features
1313
eth_default_option(VMTRACE OFF)
@@ -34,11 +34,6 @@ macro(configure_project)
3434
endif ()
3535
endif ()
3636

37-
if (STATIC_BUILD)
38-
set(STATIC_LINKING 1)
39-
set(BUILD_SHARED_LIBS 0)
40-
endif ()
41-
4237
# Define a matching property name of each of the "features".
4338
foreach(FEATURE ${ARGN})
4439
set(SUPPORT_${FEATURE} TRUE)
@@ -49,10 +44,6 @@ macro(configure_project)
4944
# and on again easily enough, and also to grep for them.
5045
add_definitions(-DDISABLE_BROKEN_UNIT_TESTS_UNTIL_WE_FIX_THEM)
5146

52-
# TODO: Eliminate this pre-processor symbol, which is a bad pattern.
53-
# Common code has no business knowing which application it is part of.
54-
add_definitions(-DETH_TRUE)
55-
5647
# Are we including the JIT EVM module?
5748
# That pulls in a quite heavyweight LLVM dependency, which is
5849
# not suitable for all platforms.
@@ -92,7 +83,7 @@ macro(configure_project)
9283
endif()
9384

9485
include(EthBuildInfo)
95-
create_build_info(${NAME})
86+
create_build_info()
9687
print_config(${NAME})
9788
endmacro()
9889

cmake/FindLevelDB.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ set(LEVELDB_LIBRARIES ${LEVELDB_LIBRARY})
2929
# This might be due to some dependency within leveldb which would be dead-code
3030
# stripped if we were using a static lib for leveldb. We aren't (yet), because
3131
# we only have partial static-linkage on OS X so far.
32-
if (STATIC_LINKING AND APPLE)
32+
if (NOT BUILD_SHARED_LIBS AND APPLE)
3333
find_path(SNAPPY_INCLUDE_DIR snappy.h PATH_SUFFIXES snappy)
3434
find_library(SNAPPY_LIBRARY snappy)
3535
set(LEVELDB_INCLUDE_DIRS ${LEVELDB_INCLUDE_DIR} ${SNAPPY_INCLUDE_DIR})

cmake/UseMiniupnpc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ function(eth_apply TARGET REQUIRED)
22
find_package (Miniupnpc 1.8.2013)
33
eth_show_dependency(MINIUPNPC miniupnpc)
44
if (MINIUPNPC AND MINIUPNPC_FOUND)
5-
target_include_directories(${TARGET} SYSTEM PUBLIC ${MINIUPNPC_INCLUDE_DIRS})
5+
target_include_directories(${TARGET} SYSTEM PRIVATE ${MINIUPNPC_INCLUDE_DIRS})
66
target_link_libraries(${TARGET} ${MINIUPNPC_LIBRARIES})
77
target_compile_definitions(${TARGET} PUBLIC ETH_MINIUPNPC)
88
elseif (NOT ${REQUIRED} STREQUAL "OPTIONAL")

0 commit comments

Comments
 (0)