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

Commit 1de944c

Browse files
authored
Merge pull request #4308 from ethereum/hunter-jsoncpp
Hunter: jsoncpp
2 parents 779db0c + 49be8e6 commit 1de944c

File tree

7 files changed

+15
-58
lines changed

7 files changed

+15
-58
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ include(EthUtils)
9898
hunter_add_package(Boost COMPONENTS filesystem random system thread test)
9999
find_package(Boost CONFIG REQUIRED filesystem random system thread unit_test_framework)
100100

101+
hunter_add_package(jsoncpp)
102+
find_package(jsoncpp CONFIG REQUIRED)
103+
101104
include(ProjectCryptopp)
102-
include(ProjectJsonCpp)
103105
include(ProjectJsonRpcCpp)
104106
include(ProjectSecp256k1)
105107
include(ProjectSnark)

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ clone_script:
5050
git submodule -q update --init --recursive
5151
}
5252
cache:
53-
- deps
53+
- deps -> cmake/ProjectJsonRpc.cmake
5454
#RDP LOGIN details for trouble shooting
5555
#init:
5656
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

cmake/EthCompilerSettings.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
# ccache is auto-enabled if the tool is found. To disable set -DCCACHE=Off option.
1919
find_program(CCACHE ccache)
2020
if(CCACHE)
21-
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
22-
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
21+
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
2322
message(STATUS "ccache enabled (${CCACHE})")
2423
endif()
2524

cmake/ProjectJsonCpp.cmake

Lines changed: 0 additions & 45 deletions
This file was deleted.

cmake/ProjectJsonRpcCpp.cmake

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# but we need to know the MHD location for static linking.
33
find_package(MHD REQUIRED)
44

5+
get_property(jsoncpp_include_dir TARGET jsoncpp_lib_static PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
6+
get_property(jsoncpp_library TARGET jsoncpp_lib_static PROPERTY IMPORTED_LOCATION_RELEASE)
7+
58
set(CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
69
-DCMAKE_BUILD_TYPE=Release
710
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
@@ -18,17 +21,17 @@ set(CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
1821
-DCOMPILE_STUBGEN=Off
1922
-DCOMPILE_EXAMPLES=Off
2023
# Point to jsoncpp library.
21-
-DJSONCPP_INCLUDE_DIR=${JSONCPP_INCLUDE_DIR}
24+
-DJSONCPP_INCLUDE_DIR=${jsoncpp_include_dir}
2225
# Select jsoncpp include prefix: <json/...> or <jsoncpp/json/...>
2326
-DJSONCPP_INCLUDE_PREFIX=json
24-
-DJSONCPP_LIBRARY=${JSONCPP_LIBRARY}
27+
-DJSONCPP_LIBRARY=${jsoncpp_library}
2528
-DMHD_INCLUDE_DIR=${MHD_INCLUDE_DIR}
2629
-DMHD_LIBRARY=${MHD_LIBRARY})
2730

2831
if (WIN32)
2932
# For Windows we have to provide also locations for debug libraries.
3033
set(CMAKE_ARGS ${CMAKE_ARGS}
31-
-DJSONCPP_LIBRARY_DEBUG=${JSONCPP_LIBRARY}
34+
-DJSONCPP_LIBRARY_DEBUG=${jsoncpp_library}
3235
-DMHD_LIBRARY_DEBUG=${MHD_LIBRARY})
3336
endif()
3437

@@ -48,8 +51,6 @@ ExternalProject_Add(jsonrpccpp
4851
LOG_INSTALL 1
4952
)
5053

51-
add_dependencies(jsonrpccpp jsoncpp)
52-
5354
# Create imported libraries
5455
if (WIN32)
5556
# On Windows CMAKE_INSTALL_PREFIX is ignored and installs to dist dir.
@@ -64,8 +65,8 @@ file(MAKE_DIRECTORY ${JSONRPCCPP_INCLUDE_DIR}) # Must exist.
6465
add_library(JsonRpcCpp::Common STATIC IMPORTED)
6566
set_property(TARGET JsonRpcCpp::Common PROPERTY IMPORTED_CONFIGURATIONS Release)
6667
set_property(TARGET JsonRpcCpp::Common PROPERTY IMPORTED_LOCATION_RELEASE ${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}jsonrpccpp-common${CMAKE_STATIC_LIBRARY_SUFFIX})
67-
set_property(TARGET JsonRpcCpp::Common PROPERTY INTERFACE_LINK_LIBRARIES JsonCpp)
68-
set_property(TARGET JsonRpcCpp::Common PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${JSONRPCCPP_INCLUDE_DIR} ${JSONCPP_INCLUDE_DIR})
68+
set_property(TARGET JsonRpcCpp::Common PROPERTY INTERFACE_LINK_LIBRARIES jsoncpp_lib_static)
69+
set_property(TARGET JsonRpcCpp::Common PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${JSONRPCCPP_INCLUDE_DIR} ${jsoncpp_include_dir})
6970
add_dependencies(JsonRpcCpp::Common jsonrpccpp)
7071

7172
add_library(JsonRpcCpp::Server STATIC IMPORTED)

libethereum/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ file(GLOB HEADERS "*.h")
33

44
add_library(ethereum ${SRC_LIST} ${HEADERS})
55

6-
target_link_libraries(ethereum ${Boost_REGEX_LIBRARIES} JsonCpp)
6+
target_link_libraries(ethereum ${Boost_REGEX_LIBRARIES} jsoncpp_lib_static)
77

88
find_package(Dev)
99
find_package(Eth)

libevm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ file(GLOB HEADERS "*.h")
2121

2222
add_library(evm ${SOURCES} ${HEADERS})
2323

24-
target_link_libraries(evm PRIVATE ethcore)
24+
target_link_libraries(evm PRIVATE ethcore jsoncpp_lib_static)
2525
target_include_directories(evm PRIVATE ..)
2626

2727
if (EVMJIT)

0 commit comments

Comments
 (0)