mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #1252 from ethereum/jsoncpp-from-source
Build jsoncpp from source using jsoncpp.cmake script
This commit is contained in:
commit
7a30e8cf6e
@ -135,10 +135,8 @@ git:
|
|||||||
cache:
|
cache:
|
||||||
ccache: true
|
ccache: true
|
||||||
directories:
|
directories:
|
||||||
- cryptopp
|
|
||||||
- boost_1_57_0
|
- boost_1_57_0
|
||||||
- build
|
- build
|
||||||
- jsoncpp
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- test $TRAVIS_INSTALL_DEPS != On || ./scripts/install_deps.sh
|
- test $TRAVIS_INSTALL_DEPS != On || ./scripts/install_deps.sh
|
||||||
@ -164,7 +162,7 @@ script:
|
|||||||
# in Solidity's RPC setup and some will be in 'eth'. It seems unlikely that Solidity
|
# in Solidity's RPC setup and some will be in 'eth'. It seems unlikely that Solidity
|
||||||
# itself is broken from the failure messages which we are seeing.
|
# itself is broken from the failure messages which we are seeing.
|
||||||
#
|
#
|
||||||
# More details on known issues at https://github.com/ethereum/solidity/issues/769
|
# More details on known issues at https://github.com/ethereum/solidity/issues/769
|
||||||
- test $TRAVIS_TESTS != On || (cd $TRAVIS_BUILD_DIR && (./scripts/tests.sh || ./scripts/tests.sh || ./scripts/tests.sh) )
|
- test $TRAVIS_TESTS != On || (cd $TRAVIS_BUILD_DIR && (./scripts/tests.sh || ./scripts/tests.sh || ./scripts/tests.sh) )
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
|
@ -13,6 +13,7 @@ project(solidity VERSION ${PROJECT_VERSION})
|
|||||||
|
|
||||||
# Let's find our dependencies
|
# Let's find our dependencies
|
||||||
include(EthDependencies)
|
include(EthDependencies)
|
||||||
|
include(deps/jsoncpp.cmake)
|
||||||
|
|
||||||
# Figure out what compiler and system are we using
|
# Figure out what compiler and system are we using
|
||||||
include(EthCompilerSettings)
|
include(EthCompilerSettings)
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
# Find jsoncpp
|
|
||||||
#
|
|
||||||
# Find the jsoncpp includes and library
|
|
||||||
#
|
|
||||||
# if you nee to add a custom library search path, do it via via CMAKE_PREFIX_PATH
|
|
||||||
#
|
|
||||||
# This module defines
|
|
||||||
# JSONCPP_INCLUDE_DIRS, where to find header, etc.
|
|
||||||
# JSONCPP_LIBRARIES, the libraries needed to use jsoncpp.
|
|
||||||
# JSONCPP_FOUND, If false, do not try to use jsoncpp.
|
|
||||||
|
|
||||||
# only look in default directories
|
|
||||||
find_path(
|
|
||||||
JSONCPP_INCLUDE_DIR
|
|
||||||
NAMES json/json.h
|
|
||||||
PATH_SUFFIXES jsoncpp
|
|
||||||
DOC "jsoncpp include dir"
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(
|
|
||||||
JSONCPP_LIBRARY
|
|
||||||
NAMES jsoncpp
|
|
||||||
DOC "jsoncpp library"
|
|
||||||
)
|
|
||||||
|
|
||||||
set(JSONCPP_INCLUDE_DIRS ${JSONCPP_INCLUDE_DIR})
|
|
||||||
set(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY})
|
|
||||||
|
|
||||||
# debug library on windows
|
|
||||||
# same naming convention as in qt (appending debug library with d)
|
|
||||||
# boost is using the same "hack" as us with "optimized" and "debug"
|
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
||||||
|
|
||||||
find_library(
|
|
||||||
JSONCPP_LIBRARY_DEBUG
|
|
||||||
NAMES jsoncppd
|
|
||||||
DOC "jsoncpp debug library"
|
|
||||||
)
|
|
||||||
|
|
||||||
set(JSONCPP_LIBRARIES optimized ${JSONCPP_LIBRARIES} debug ${JSONCPP_LIBRARY_DEBUG})
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set JSONCPP_FOUND to TRUE
|
|
||||||
# if all listed variables are TRUE, hide their existence from configuration view
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
find_package_handle_standard_args(jsoncpp DEFAULT_MSG
|
|
||||||
JSONCPP_LIBRARY JSONCPP_INCLUDE_DIR)
|
|
||||||
mark_as_advanced (JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY)
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
function(eth_apply TARGET REQUIRED)
|
|
||||||
find_package (Jsoncpp 0.60)
|
|
||||||
eth_show_dependency(JSONCPP JsonCpp)
|
|
||||||
if (JSONCPP_FOUND)
|
|
||||||
target_include_directories(${TARGET} SYSTEM BEFORE PUBLIC ${JSONCPP_INCLUDE_DIRS})
|
|
||||||
target_link_libraries(${TARGET} ${JSONCPP_LIBRARIES})
|
|
||||||
elseif (NOT ${REQUIRED} STREQUAL "OPTIONAL")
|
|
||||||
message(FATAL_ERROR "Jsoncpp library not found")
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
@ -15,8 +15,7 @@ function(eth_apply TARGET REQUIRED SUBMODULE)
|
|||||||
target_include_directories(${TARGET} PUBLIC ${Solidity_INCLUDE_DIRS})
|
target_include_directories(${TARGET} PUBLIC ${Solidity_INCLUDE_DIRS})
|
||||||
|
|
||||||
if (${SUBMODULE} STREQUAL "solevmasm")
|
if (${SUBMODULE} STREQUAL "solevmasm")
|
||||||
eth_use(${TARGET} ${REQUIRED} Jsoncpp)
|
target_link_libraries(${TARGET} ${Solidity_SOLEVMASM_LIBRARIES} jsoncpp)
|
||||||
target_link_libraries(${TARGET} ${Solidity_SOLEVMASM_LIBRARIES})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (${SUBMODULE} STREQUAL "lll")
|
if (${SUBMODULE} STREQUAL "lll")
|
||||||
|
2
deps
2
deps
@ -1 +1 @@
|
|||||||
Subproject commit f2ede70f33633b26a27299ff39995914db2c6923
|
Subproject commit 03f3b63826b8b6e88355b30b725aa1b8df760f24
|
@ -70,7 +70,6 @@
|
|||||||
|
|
||||||
#include "vector_ref.h"
|
#include "vector_ref.h"
|
||||||
|
|
||||||
// CryptoPP defines byte in the global namespace, so must we.
|
|
||||||
using byte = uint8_t;
|
using byte = uint8_t;
|
||||||
|
|
||||||
// Quote a given token stream to turn it into a string.
|
// Quote a given token stream to turn it into a string.
|
||||||
|
@ -8,6 +8,7 @@ file(GLOB HEADERS "*.h")
|
|||||||
|
|
||||||
include_directories(BEFORE ..)
|
include_directories(BEFORE ..)
|
||||||
add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS})
|
add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS})
|
||||||
eth_use(${EXECUTABLE} REQUIRED Jsoncpp Dev::soldevcore)
|
eth_use(${EXECUTABLE} REQUIRED Dev::soldevcore)
|
||||||
|
target_link_libraries(${EXECUTABLE} jsoncpp)
|
||||||
|
|
||||||
install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib )
|
install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib )
|
||||||
|
@ -5,9 +5,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB")
|
|||||||
|
|
||||||
aux_source_directory(. SRC_LIST)
|
aux_source_directory(. SRC_LIST)
|
||||||
|
|
||||||
#include_directories(BEFORE ${JSONCPP_INCLUDE_DIRS})
|
|
||||||
#include_directories(${Boost_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
set(EXECUTABLE lll)
|
set(EXECUTABLE lll)
|
||||||
|
|
||||||
file(GLOB HEADERS "*.h")
|
file(GLOB HEADERS "*.h")
|
||||||
|
@ -105,7 +105,6 @@ case $(uname -s) in
|
|||||||
|
|
||||||
brew install boost
|
brew install boost
|
||||||
brew install cmake
|
brew install cmake
|
||||||
brew install jsoncpp
|
|
||||||
|
|
||||||
# We should really 'brew install' our eth client here, but at the time of writing
|
# We should really 'brew install' our eth client here, but at the time of writing
|
||||||
# the bottle is known broken, so we will just cheat and use a hardcoded ZIP for
|
# the bottle is known broken, so we will just cheat and use a hardcoded ZIP for
|
||||||
@ -164,7 +163,7 @@ case $(uname -s) in
|
|||||||
# See https://pkgs.alpinelinux.org/
|
# See https://pkgs.alpinelinux.org/
|
||||||
|
|
||||||
apk update
|
apk update
|
||||||
apk add boost-dev build-base cmake jsoncpp-dev
|
apk add boost-dev build-base cmake
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@ -219,7 +218,6 @@ case $(uname -s) in
|
|||||||
gcc \
|
gcc \
|
||||||
git \
|
git \
|
||||||
libboost-all-dev \
|
libboost-all-dev \
|
||||||
libjsoncpp-dev \
|
|
||||||
unzip
|
unzip
|
||||||
|
|
||||||
;;
|
;;
|
||||||
@ -321,8 +319,7 @@ case $(uname -s) in
|
|||||||
build-essential \
|
build-essential \
|
||||||
cmake \
|
cmake \
|
||||||
git \
|
git \
|
||||||
libboost-all-dev \
|
libboost-all-dev
|
||||||
libjsoncpp-dev
|
|
||||||
|
|
||||||
# Install 'eth', for use in the Solidity Tests-over-IPC.
|
# Install 'eth', for use in the Solidity Tests-over-IPC.
|
||||||
sudo add-apt-repository -y ppa:ethereum/ethereum
|
sudo add-apt-repository -y ppa:ethereum/ethereum
|
||||||
@ -363,9 +360,6 @@ case $(uname -s) in
|
|||||||
sudo yum -y remove boost-devel
|
sudo yum -y remove boost-devel
|
||||||
sudo wget http://repo.enetres.net/enetres.repo -O /etc/yum.repos.d/enetres.repo
|
sudo wget http://repo.enetres.net/enetres.repo -O /etc/yum.repos.d/enetres.repo
|
||||||
sudo yum install boost-devel
|
sudo yum install boost-devel
|
||||||
|
|
||||||
# And finally jsoncpp
|
|
||||||
sudo yum -y install jsoncpp-devel
|
|
||||||
else
|
else
|
||||||
echo "Aborted CentOS Solidity Dependency Installation";
|
echo "Aborted CentOS Solidity Dependency Installation";
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -76,21 +76,6 @@ cp /tmp/${packagename}_${debversion}.orig.tar.gz ../
|
|||||||
|
|
||||||
# Create debian package information
|
# Create debian package information
|
||||||
|
|
||||||
case $distribution in
|
|
||||||
trusty)
|
|
||||||
jsoncpplib=libjsoncpp0
|
|
||||||
;;
|
|
||||||
vivid)
|
|
||||||
jsoncpplib=libjsoncpp0
|
|
||||||
;;
|
|
||||||
wily)
|
|
||||||
jsoncpplib=libjsoncpp0v5
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
jsoncpplib=libjsoncpp1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
mkdir debian
|
mkdir debian
|
||||||
echo 9 > debian/compat
|
echo 9 > debian/compat
|
||||||
cat <<EOF > debian/control
|
cat <<EOF > debian/control
|
||||||
@ -99,7 +84,6 @@ Section: science
|
|||||||
Priority: extra
|
Priority: extra
|
||||||
Maintainer: Christian (Buildserver key) <builds@ethereum.org>
|
Maintainer: Christian (Buildserver key) <builds@ethereum.org>
|
||||||
Build-Depends: debhelper (>= 9.0.0),
|
Build-Depends: debhelper (>= 9.0.0),
|
||||||
libcryptopp-dev,
|
|
||||||
cmake,
|
cmake,
|
||||||
g++-4.8,
|
g++-4.8,
|
||||||
git,
|
git,
|
||||||
@ -107,8 +91,7 @@ Build-Depends: debhelper (>= 9.0.0),
|
|||||||
libboost-all-dev,
|
libboost-all-dev,
|
||||||
automake,
|
automake,
|
||||||
libtool,
|
libtool,
|
||||||
scons,
|
scons
|
||||||
libjsoncpp-dev
|
|
||||||
Standards-Version: 3.9.5
|
Standards-Version: 3.9.5
|
||||||
Homepage: https://ethereum.org
|
Homepage: https://ethereum.org
|
||||||
Vcs-Git: git://github.com/ethereum/solidity.git
|
Vcs-Git: git://github.com/ethereum/solidity.git
|
||||||
@ -117,7 +100,7 @@ Vcs-Browser: https://github.com/ethereum/solidity
|
|||||||
Package: solc
|
Package: solc
|
||||||
Architecture: any-i386 any-amd64
|
Architecture: any-i386 any-amd64
|
||||||
Multi-Arch: same
|
Multi-Arch: same
|
||||||
Depends: \${shlibs:Depends}, \${misc:Depends}, $jsoncpplib
|
Depends: \${shlibs:Depends}, \${misc:Depends}
|
||||||
Replaces: lllc (<< 1:0.3.6)
|
Replaces: lllc (<< 1:0.3.6)
|
||||||
Conflicts: libethereum (<= 1.2.9)
|
Conflicts: libethereum (<= 1.2.9)
|
||||||
Description: Solidity compiler.
|
Description: Solidity compiler.
|
||||||
|
@ -40,32 +40,6 @@ apt-get -y install git-core
|
|||||||
|
|
||||||
export WORKSPACE=/src
|
export WORKSPACE=/src
|
||||||
|
|
||||||
# CryptoPP
|
|
||||||
echo -en 'travis_fold:start:compiling_cryptopp\\r'
|
|
||||||
cd "$WORKSPACE/cryptopp"
|
|
||||||
# if .git exists, it is a fresh checkout, otherwise it comes from the cache
|
|
||||||
# and is already compiled
|
|
||||||
test -e .git && (
|
|
||||||
emcmake cmake -DCRYPTOPP_LIBRARY_TYPE=STATIC -DCRYPTOPP_RUNTIME_TYPE=STATIC && emmake make -j 4
|
|
||||||
ln -s . src/cryptopp || true
|
|
||||||
rm -rf .git
|
|
||||||
)
|
|
||||||
echo -en 'travis_fold:end:compiling_cryptopp\\r'
|
|
||||||
|
|
||||||
# Json-CPP
|
|
||||||
echo -en 'travis_fold:start:compiling_jsoncpp\\r'
|
|
||||||
cd "$WORKSPACE/jsoncpp"
|
|
||||||
# if .git exists, it is a fresh checkout, otherwise it comes from the cache
|
|
||||||
# and is already compiled
|
|
||||||
test -e .git && (
|
|
||||||
emcmake cmake -DJSONCPP_LIB_BUILD_STATIC=ON -DJSONCPP_LIB_BUILD_SHARED=OFF \
|
|
||||||
-DJSONCPP_WITH_TESTS=OFF -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF \
|
|
||||||
-G "Unix Makefiles" .
|
|
||||||
emmake make -j 4
|
|
||||||
rm -rf .git
|
|
||||||
)
|
|
||||||
echo -en 'travis_fold:end:compiling_jsoncpp\\r'
|
|
||||||
|
|
||||||
# Boost
|
# Boost
|
||||||
echo -en 'travis_fold:start:compiling_boost\\r'
|
echo -en 'travis_fold:start:compiling_boost\\r'
|
||||||
cd "$WORKSPACE"/boost_1_57_0
|
cd "$WORKSPACE"/boost_1_57_0
|
||||||
@ -112,10 +86,6 @@ emcmake cmake \
|
|||||||
-DBoost_THREAD_LIBRARIES="$WORKSPACE"/boost_1_57_0/libboost_thread.a \
|
-DBoost_THREAD_LIBRARIES="$WORKSPACE"/boost_1_57_0/libboost_thread.a \
|
||||||
-DBoost_UNIT_TEST_FRAMEWORK_LIBRARY="$WORKSPACE"/boost_1_57_0/libboost_unit_test_framework.a \
|
-DBoost_UNIT_TEST_FRAMEWORK_LIBRARY="$WORKSPACE"/boost_1_57_0/libboost_unit_test_framework.a \
|
||||||
-DBoost_UNIT_TEST_FRAMEWORK_LIBRARIES="$WORKSPACE"/boost_1_57_0/libboost_unit_test_framework.a \
|
-DBoost_UNIT_TEST_FRAMEWORK_LIBRARIES="$WORKSPACE"/boost_1_57_0/libboost_unit_test_framework.a \
|
||||||
-DJSONCPP_LIBRARY="$WORKSPACE"/jsoncpp/src/lib_json/libjsoncpp.a \
|
|
||||||
-DJSONCPP_INCLUDE_DIR="$WORKSPACE"/jsoncpp/include/ \
|
|
||||||
-DCRYPTOPP_LIBRARY="$WORKSPACE"/cryptopp/src/libcryptlib.a \
|
|
||||||
-DCRYPTOPP_INCLUDE_DIR="$WORKSPACE"/cryptopp/src/ \
|
|
||||||
-DDev_DEVCORE_LIBRARY="$WORKSPACE"/solidity/build/libdevcore/libsoldevcore.a \
|
-DDev_DEVCORE_LIBRARY="$WORKSPACE"/solidity/build/libdevcore/libsoldevcore.a \
|
||||||
-DEth_EVMASM_LIBRARY="$WORKSPACE"/solidity/build/libevmasm/libsolevmasm.a \
|
-DEth_EVMASM_LIBRARY="$WORKSPACE"/solidity/build/libevmasm/libsolevmasm.a \
|
||||||
-DETH_STATIC=1 -DTESTS=0 \
|
-DETH_STATIC=1 -DTESTS=0 \
|
||||||
|
@ -30,8 +30,6 @@
|
|||||||
set -ev
|
set -ev
|
||||||
|
|
||||||
echo -en 'travis_fold:start:installing_dependencies\\r'
|
echo -en 'travis_fold:start:installing_dependencies\\r'
|
||||||
test -e cryptopp -a -e cryptopp/src || git clone https://github.com/mmoss/cryptopp.git
|
|
||||||
test -e jsoncpp -a -e jsoncpp/include || git clone https://github.com/open-source-parsers/jsoncpp.git
|
|
||||||
test -e boost_1_57_0 -a -e boost_1_57_0/boost || (
|
test -e boost_1_57_0 -a -e boost_1_57_0/boost || (
|
||||||
wget 'http://downloads.sourceforge.net/project/boost/boost/'\
|
wget 'http://downloads.sourceforge.net/project/boost/boost/'\
|
||||||
'1.57.0/boost_1_57_0.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2F'\
|
'1.57.0/boost_1_57_0.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2F'\
|
||||||
|
Loading…
Reference in New Issue
Block a user