From 0b49fd34931bd27c47b2f9dea39f4c75b3b2937f Mon Sep 17 00:00:00 2001 From: Alexander Arlt Date: Fri, 16 Feb 2018 00:03:12 +0100 Subject: [PATCH] CMake: Update jsoncpp to v1.8.4 --- Changelog.md | 1 + cmake/jsoncpp.cmake | 16 +++++----------- libdevcore/JSON.cpp | 4 ++-- scripts/create_source_tarball.sh | 2 +- scripts/release_ppa.sh | 2 +- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Changelog.md b/Changelog.md index 0fbce7c50..f51bd634a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,7 @@ ### 0.4.24 (unreleased) Features: + * Build System: Update internal dependency of jsoncpp to 1.8.4, which introduces more strictness and reduces memory usage. * Optimizer: Remove unnecessary masking of the result of known short instructions (``ADDRESS``, ``CALLER``, ``ORIGIN`` and ``COINBASE``). * Type Checker: Make literals (without explicit type casting) an error for tight packing as experimental 0.5.0 feature. diff --git a/cmake/jsoncpp.cmake b/cmake/jsoncpp.cmake index 6ddf4c74c..7a9d7e400 100644 --- a/cmake/jsoncpp.cmake +++ b/cmake/jsoncpp.cmake @@ -6,15 +6,9 @@ else() set(JSONCPP_CMAKE_COMMAND ${CMAKE_COMMAND}) endif() -# Disable implicit fallthrough warning in jsoncpp for gcc >= 7 until the upstream handles it properly -if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) - set(JSONCCP_EXTRA_FLAGS -Wno-implicit-fallthrough) -else() - set(JSONCCP_EXTRA_FLAGS "") -endif() - +include(GNUInstallDirs) set(prefix "${CMAKE_BINARY_DIR}/deps") -set(JSONCPP_LIBRARY "${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX}") +set(JSONCPP_LIBRARY "${prefix}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX}") set(JSONCPP_INCLUDE_DIR "${prefix}/include") set(byproducts "") @@ -25,9 +19,9 @@ endif() ExternalProject_Add(jsoncpp-project PREFIX "${prefix}" DOWNLOAD_DIR "${CMAKE_SOURCE_DIR}/deps/downloads" - DOWNLOAD_NAME jsoncpp-1.7.7.tar.gz - URL https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz - URL_HASH SHA256=087640ebcf7fbcfe8e2717a0b9528fff89c52fcf69fa2a18cc2b538008098f97 + DOWNLOAD_NAME jsoncpp-1.8.4.tar.gz + URL https://github.com/open-source-parsers/jsoncpp/archive/1.8.4.tar.gz + URL_HASH SHA256=c49deac9e0933bcb7044f08516861a2d560988540b23de2ac1ad443b219afdb6 CMAKE_COMMAND ${JSONCPP_CMAKE_COMMAND} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} diff --git a/libdevcore/JSON.cpp b/libdevcore/JSON.cpp index d99b3bc6f..6317cc896 100644 --- a/libdevcore/JSON.cpp +++ b/libdevcore/JSON.cpp @@ -28,8 +28,8 @@ using namespace std; static_assert( - (JSONCPP_VERSION_MAJOR == 1) && (JSONCPP_VERSION_MINOR == 7) && (JSONCPP_VERSION_PATCH == 7), - "Unexpected jsoncpp version: " JSONCPP_VERSION_STRING ". Expecting 1.7.7." + (JSONCPP_VERSION_MAJOR == 1) && (JSONCPP_VERSION_MINOR == 8) && (JSONCPP_VERSION_PATCH == 4), + "Unexpected jsoncpp version: " JSONCPP_VERSION_STRING ". Expecting 1.8.4." ); namespace dev diff --git a/scripts/create_source_tarball.sh b/scripts/create_source_tarball.sh index 9e66799a9..4e9307075 100755 --- a/scripts/create_source_tarball.sh +++ b/scripts/create_source_tarball.sh @@ -32,7 +32,7 @@ REPO_ROOT="$(dirname "$0")"/.. fi # Add dependencies mkdir -p "$SOLDIR/deps/downloads/" 2>/dev/null || true - wget -O "$SOLDIR/deps/downloads/jsoncpp-1.7.7.tar.gz" https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz + wget -O "$SOLDIR/deps/downloads/jsoncpp-1.8.4.tar.gz" https://github.com/open-source-parsers/jsoncpp/archive/1.8.4.tar.gz mkdir -p "$REPO_ROOT/upload" tar czf "$REPO_ROOT/upload/solidity_$versionstring.tar.gz" -C "$TEMPDIR" "solidity_$versionstring" rm -r "$TEMPDIR" diff --git a/scripts/release_ppa.sh b/scripts/release_ppa.sh index 375b4d1b0..b16013361 100755 --- a/scripts/release_ppa.sh +++ b/scripts/release_ppa.sh @@ -76,7 +76,7 @@ mv solidity solc # Fetch jsoncpp dependency mkdir -p ./solc/deps/downloads/ 2>/dev/null || true -wget -O ./solc/deps/downloads/jsoncpp-1.7.7.tar.gz https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz +wget -O ./solc/deps/downloads/jsoncpp-1.8.4.tar.gz https://github.com/open-source-parsers/jsoncpp/archive/1.8.4.tar.gz # Determine version cd solc