Merge pull request #3467 from aarlt/strict-mode-jsoncpp-1.8.4

cmake/jsoncpp.cmake: update to jsoncpp v1.8.4
This commit is contained in:
Alex Beregszaszi 2018-04-23 14:39:14 +01:00 committed by GitHub
commit c7ee2ca0b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 16 deletions

View File

@ -1,6 +1,7 @@
### 0.4.24 (unreleased) ### 0.4.24 (unreleased)
Features: 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``). * 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. * Type Checker: Make literals (without explicit type casting) an error for tight packing as experimental 0.5.0 feature.

View File

@ -6,17 +6,15 @@ else()
set(JSONCPP_CMAKE_COMMAND ${CMAKE_COMMAND}) set(JSONCPP_CMAKE_COMMAND ${CMAKE_COMMAND})
endif() endif()
# Disable implicit fallthrough warning in jsoncpp for gcc >= 7 until the upstream handles it properly include(GNUInstallDirs)
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()
set(prefix "${CMAKE_BINARY_DIR}/deps") 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(JSONCPP_INCLUDE_DIR "${prefix}/include")
if(NOT MSVC)
set(JSONCPP_EXTRA_FLAGS "-std=c++11")
endif()
set(byproducts "") set(byproducts "")
if(CMAKE_VERSION VERSION_GREATER 3.1) if(CMAKE_VERSION VERSION_GREATER 3.1)
set(byproducts BUILD_BYPRODUCTS "${JSONCPP_LIBRARY}") set(byproducts BUILD_BYPRODUCTS "${JSONCPP_LIBRARY}")
@ -25,9 +23,9 @@ endif()
ExternalProject_Add(jsoncpp-project ExternalProject_Add(jsoncpp-project
PREFIX "${prefix}" PREFIX "${prefix}"
DOWNLOAD_DIR "${CMAKE_SOURCE_DIR}/deps/downloads" DOWNLOAD_DIR "${CMAKE_SOURCE_DIR}/deps/downloads"
DOWNLOAD_NAME jsoncpp-1.7.7.tar.gz DOWNLOAD_NAME jsoncpp-1.8.4.tar.gz
URL https://github.com/open-source-parsers/jsoncpp/archive/1.7.7.tar.gz URL https://github.com/open-source-parsers/jsoncpp/archive/1.8.4.tar.gz
URL_HASH SHA256=087640ebcf7fbcfe8e2717a0b9528fff89c52fcf69fa2a18cc2b538008098f97 URL_HASH SHA256=c49deac9e0933bcb7044f08516861a2d560988540b23de2ac1ad443b219afdb6
CMAKE_COMMAND ${JSONCPP_CMAKE_COMMAND} CMAKE_COMMAND ${JSONCPP_CMAKE_COMMAND}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
@ -36,7 +34,7 @@ ExternalProject_Add(jsoncpp-project
-DCMAKE_POSITION_INDEPENDENT_CODE=${BUILD_SHARED_LIBS} -DCMAKE_POSITION_INDEPENDENT_CODE=${BUILD_SHARED_LIBS}
-DJSONCPP_WITH_TESTS=OFF -DJSONCPP_WITH_TESTS=OFF
-DJSONCPP_WITH_PKGCONFIG_SUPPORT=OFF -DJSONCPP_WITH_PKGCONFIG_SUPPORT=OFF
-DCMAKE_CXX_FLAGS=${JSONCCP_EXTRA_FLAGS} -DCMAKE_CXX_FLAGS=${JSONCPP_EXTRA_FLAGS}
# Overwrite build and install commands to force Release build on MSVC. # Overwrite build and install commands to force Release build on MSVC.
BUILD_COMMAND cmake --build <BINARY_DIR> --config Release BUILD_COMMAND cmake --build <BINARY_DIR> --config Release
INSTALL_COMMAND cmake --build <BINARY_DIR> --config Release --target install INSTALL_COMMAND cmake --build <BINARY_DIR> --config Release --target install

View File

@ -28,8 +28,8 @@
using namespace std; using namespace std;
static_assert( static_assert(
(JSONCPP_VERSION_MAJOR == 1) && (JSONCPP_VERSION_MINOR == 7) && (JSONCPP_VERSION_PATCH == 7), (JSONCPP_VERSION_MAJOR == 1) && (JSONCPP_VERSION_MINOR == 8) && (JSONCPP_VERSION_PATCH == 4),
"Unexpected jsoncpp version: " JSONCPP_VERSION_STRING ". Expecting 1.7.7." "Unexpected jsoncpp version: " JSONCPP_VERSION_STRING ". Expecting 1.8.4."
); );
namespace dev namespace dev

View File

@ -32,7 +32,7 @@ REPO_ROOT="$(dirname "$0")"/..
fi fi
# Add dependencies # Add dependencies
mkdir -p "$SOLDIR/deps/downloads/" 2>/dev/null || true 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" mkdir -p "$REPO_ROOT/upload"
tar czf "$REPO_ROOT/upload/solidity_$versionstring.tar.gz" -C "$TEMPDIR" "solidity_$versionstring" tar czf "$REPO_ROOT/upload/solidity_$versionstring.tar.gz" -C "$TEMPDIR" "solidity_$versionstring"
rm -r "$TEMPDIR" rm -r "$TEMPDIR"

View File

@ -18,6 +18,8 @@ esac
BIN=$PREFIX/bin BIN=$PREFIX/bin
PATH=$PREFIX/bin:$PATH
if test -f $BIN/cmake && ($BIN/cmake --version | grep -q "$VERSION"); then if test -f $BIN/cmake && ($BIN/cmake --version | grep -q "$VERSION"); then
echo "CMake $VERSION already installed in $BIN" echo "CMake $VERSION already installed in $BIN"
else else

View File

@ -76,7 +76,7 @@ mv solidity solc
# Fetch jsoncpp dependency # Fetch jsoncpp dependency
mkdir -p ./solc/deps/downloads/ 2>/dev/null || true 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 # Determine version
cd solc cd solc

View File

@ -40,6 +40,12 @@ if ! type git &>/dev/null; then
apt-get -y install git-core apt-get -y install git-core
fi fi
if ! type wget &>/dev/null; then
# We need wget to install cmake
apt-get update
apt-get -y install wget
fi
WORKSPACE=/root/project WORKSPACE=/root/project
# Increase nodejs stack size # Increase nodejs stack size
@ -67,6 +73,10 @@ rm -rf b2 libs doc tools more bin.v2 status
) )
echo -en 'travis_fold:end:compiling_boost\\r' echo -en 'travis_fold:end:compiling_boost\\r'
echo -en 'travis_fold:start:install_cmake.sh\\r'
source $WORKSPACE/scripts/install_cmake.sh
echo -en 'travis_fold:end:install_cmake.sh\\r'
# Build dependent components and solidity itself # Build dependent components and solidity itself
echo -en 'travis_fold:start:compiling_solidity\\r' echo -en 'travis_fold:start:compiling_solidity\\r'
cd $WORKSPACE cd $WORKSPACE