aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-12-12 07:38:38 +0800
committerGitHub <noreply@github.com>2018-12-12 07:38:38 +0800
commit1476acb8045033a9a3d2e1a1d13c5aaa8ed6942c (patch)
treead1b64a3b0480768b0d739b9c563a68756e410b9
parente74d9df20d1d1e8253cf51ef8d4191e9a0f51e14 (diff)
parent5b86e3ec50b757def69a9aed9bc70fac1a8ed652 (diff)
downloaddexon-solidity-1476acb8045033a9a3d2e1a1d13c5aaa8ed6942c.tar.gz
dexon-solidity-1476acb8045033a9a3d2e1a1d13c5aaa8ed6942c.tar.zst
dexon-solidity-1476acb8045033a9a3d2e1a1d13c5aaa8ed6942c.zip
Merge pull request #5502 from ethereum/cpp14
Enables C++14 standard (was C++11) within the Solidity compiler project.
-rw-r--r--.travis.yml37
-rw-r--r--cmake/EthCompilerSettings.cmake4
-rw-r--r--cmake/jsoncpp.cmake4
-rwxr-xr-xscripts/release_ppa.sh4
4 files changed, 35 insertions, 14 deletions
diff --git a/.travis.yml b/.travis.yml
index d68c79ba..8da17c45 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -55,6 +55,18 @@ matrix:
env:
- ZIP_SUFFIX=ubuntu-trusty
- SOLC_STOREBYTECODE=On
+ before_install:
+ - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
+ - sudo add-apt-repository -y ppa:mhier/libboost-latest
+ - sudo add-apt-repository -y ppa:hvr/z3
+ - sudo apt-get update -qq
+ install:
+ - sudo apt-get install -qq g++-8 gcc-8
+ - sudo apt-get install -qq libboost1.67-dev
+ - sudo apt-get install -qq libleveldb1
+ - sudo apt-get install -qq libz3-dev
+ - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 90
+ - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 90
- os: linux
dist: trusty
@@ -63,6 +75,18 @@ matrix:
env:
- ZIP_SUFFIX=ubuntu-trusty-clang
- SOLC_STOREBYTECODE=On
+ before_install:
+ - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
+ - sudo add-apt-repository -y ppa:mhier/libboost-latest
+ - sudo add-apt-repository -y ppa:hvr/z3
+ - sudo apt-get update -qq
+ install:
+ - sudo apt-get install -qq g++-8 gcc-8
+ - sudo apt-get install -qq libboost1.67-dev
+ - sudo apt-get install -qq libleveldb1
+ - sudo apt-get install -qq libz3-dev
+ - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 90
+ - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 90
# Docker target, which generates a statically linked alpine image
- os: linux
@@ -159,18 +183,15 @@ cache:
install:
- test $SOLC_INSTALL_DEPS_TRAVIS != On || (scripts/install_deps.sh)
- test "$TRAVIS_OS_NAME" != "linux" || (scripts/install_cmake.sh)
+
+before_script:
# Disable tests unless run on the release branch, on tags or with daily cron
- #- if [ "$TRAVIS_BRANCH" != release -a -z "$TRAVIS_TAG" -a "$TRAVIS_EVENT_TYPE" != cron ]; then SOLC_TESTS=Off; fi
- - SOLC_TESTS=Off
+ - if [ "$TRAVIS_BRANCH" != release -a -z "$TRAVIS_TAG" -a "$TRAVIS_EVENT_TYPE" != cron ]; then SOLC_TESTS=Off; fi
- if [ "$TRAVIS_BRANCH" = release -o -n "$TRAVIS_TAG" ]; then echo -n > prerelease.txt; else date -u +"nightly.%Y.%-m.%-d" > prerelease.txt; fi
- echo -n "$TRAVIS_COMMIT" > commit_hash.txt
-
-before_script:
- test $SOLC_EMSCRIPTEN != On || (scripts/build_emscripten.sh)
- test $SOLC_DOCKER != On || (scripts/docker_build.sh)
- - test $SOLC_RELEASE != On || (scripts/build.sh $SOLC_BUILD_TYPE
- && scripts/release.sh $ZIP_SUFFIX
- && scripts/create_source_tarball.sh)
+ - test $SOLC_RELEASE != On || (scripts/build.sh $SOLC_BUILD_TYPE -DBoost_USE_STATIC_LIBS=OFF && scripts/create_source_tarball.sh)
script:
- test $SOLC_EMSCRIPTEN != On -o $SOLC_TESTS != On || (scripts/test_emscripten.sh)
@@ -204,7 +225,7 @@ deploy:
- release
- /^v\d/
# This is the deploy target for the native build (Linux and macOS)
- # which generates ZIPs per commit and the source tarball.
+ # which generates the source tarball.
#
# This runs for each tag that is created and adds the corresponding files.
- provider: releases
diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake
index b4cc6656..70505fdb 100644
--- a/cmake/EthCompilerSettings.cmake
+++ b/cmake/EthCompilerSettings.cmake
@@ -25,8 +25,8 @@ eth_add_cxx_compiler_flag_if_supported(-Wimplicit-fallthrough)
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
- # Use ISO C++11 standard language.
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ # Use ISO C++14 standard language.
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
# Enables all the warnings about constructions that some users consider questionable,
# and that are easy to avoid. Also enable some extra warning flags that are not
diff --git a/cmake/jsoncpp.cmake b/cmake/jsoncpp.cmake
index ea3218ef..318a526e 100644
--- a/cmake/jsoncpp.cmake
+++ b/cmake/jsoncpp.cmake
@@ -15,9 +15,9 @@ set(JSONCPP_INCLUDE_DIR "${prefix}/include")
# versions used in the CI runs.
if(EMSCRIPTEN)
# Do not include all flags in CMAKE_CXX_FLAGS for emscripten,
- # but only use -std=c++11. Using all flags causes build failures
+ # but only use -std=c++14. Using all flags causes build failures
# at the moment.
- set(JSONCPP_CXX_FLAGS -std=c++11)
+ set(JSONCPP_CXX_FLAGS -std=c++14)
else()
set(JSONCPP_CXX_FLAGS ${CMAKE_CXX_FLAGS})
endif()
diff --git a/scripts/release_ppa.sh b/scripts/release_ppa.sh
index 36a8ef7f..e842bd53 100755
--- a/scripts/release_ppa.sh
+++ b/scripts/release_ppa.sh
@@ -114,7 +114,7 @@ Priority: extra
Maintainer: Christian (Buildserver key) <builds@ethereum.org>
Build-Depends: ${Z3DEPENDENCY}debhelper (>= 9.0.0),
cmake,
- g++-4.8,
+ g++-8,
git,
libgmp-dev,
libboost-all-dev,
@@ -168,7 +168,7 @@ override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
override_dh_auto_configure:
- dh_auto_configure -- -DINSTALL_LLLC=Off
+ dh_auto_configure -- -DINSTALL_LLLC=Off -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8
EOF
cat <<EOF > debian/copyright
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/