Merge pull request #178 from ethereum/c++17

C++17
This commit is contained in:
Paweł Bylica 2019-01-15 17:02:00 +01:00 committed by GitHub
commit 5021229a9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 58 additions and 10 deletions

View File

@ -16,6 +16,7 @@ option(HUNTER_ENABLED "Enable Hunter package manager support" "${EVMC_TESTING}")
include(cmake/cable/bootstrap.cmake)
include(CableBuildType)
include(CableCompilerSettings)
include(CableToolchains)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
@ -25,6 +26,8 @@ if(EVMC_TESTING)
include(defaults/HunterCacheServers)
endif()
cable_configure_toolchain(DEFAULT cxx11-pic)
project(evmc)
set(PROJECT_VERSION 6.1.0-dev)

View File

@ -3,7 +3,7 @@ jobs:
lint:
docker:
- image: ethereum/cpp-build-env
- image: ethereum/cpp-build-env:7
steps:
- checkout
- run:
@ -18,15 +18,15 @@ jobs:
sudo pip3 install codespell
codespell --quiet-level=4 --ignore-words=./.codespell-whitelist
build: &build
build-cxx11: &build
docker:
- image: ethereum/cpp-build-env
- image: ethereum/cpp-build-env:7
steps:
- checkout
- run:
name: "Configure"
working_directory: ~/build
command: cmake ../project -DCMAKE_INSTALL_PREFIX=~/install -DBUILD_SHARED_LIBS=ON -DEVMC_EXAMPLES=ON -DEVMC_TESTING=ON
command: cmake ../project -DCMAKE_INSTALL_PREFIX=~/install -DBUILD_SHARED_LIBS=ON -DEVMC_EXAMPLES=ON -DEVMC_TESTING=ON $CMAKE_OPTIONS
- run:
name: "Build"
command: cmake --build ~/build
@ -63,11 +63,19 @@ jobs:
name: "Run evmc-vmtester libevmc-example-vm.so"
command: ~/install/bin/evmc-vmtester ~/install/lib/libevmc-example-vm.so
build-clang-3.8:
build-cxx14:
<<: *build
environment:
CC: clang-3.8
CXX: clang++-3.8
CMAKE_OPTIONS: -DTOOLCHAIN=cxx14-pic
build-cxx17:
<<: *build
environment:
CC: gcc-6
CXX: g++-6
CMAKE_OPTIONS: -DTOOLCHAIN=cxx17-pic
test-docs:
docker:
@ -133,8 +141,9 @@ workflows:
evmc:
jobs:
- lint
- build
- build-clang-3.8
- build-cxx11
- build-cxx14
- build-cxx17
- bindings-go-1.11
- bindings-go-1.10
- bindings-go-1.9

View File

@ -32,7 +32,7 @@ macro(cable_configure_compiler)
if(NOT PROJECT_IS_NESTED)
# Do this configuration only in the top project.
cmake_parse_arguments(cable "NO_CONVERSION_WARNINGS;NO_STACK_PROTECTION" "" "" ${ARGN})
cmake_parse_arguments(cable "NO_CONVERSION_WARNINGS;NO_STACK_PROTECTION;NO_PEDANTIC" "" "" ${ARGN})
if(cable_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "cable_configure_compiler: Unknown options: ${cable_UNPARSED_ARGUMENTS}")
@ -52,8 +52,12 @@ macro(cable_configure_compiler)
if(CABLE_COMPILER_GNULIKE)
if(NOT cable_NO_PEDANTIC)
add_compile_options(-pedantic)
endif()
# Enable basing warnings set and treat them as errors.
add_compile_options(-pedantic -Werror -Wall -Wextra)
add_compile_options(-Werror -Wall -Wextra)
if(NOT cable_NO_CONVERSION_WARNINGS)
# Enable conversion warnings if not explicitly disabled.

View File

@ -10,7 +10,7 @@
#
# This is internal variable automatically updated with external tools.
# Use CABLE_VERSION variable if you need this information.
set(version 0.2.14)
set(version 0.2.16)
# For convenience, add the project CMake module dir to module path.
set(module_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

View File

@ -0,0 +1,9 @@
# Cable: CMake Bootstrap Library.
# Copyright 2019 Pawel Bylica.
# Licensed under the Apache License, Version 2.0.
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

7
toolchains/cxx14.cmake Normal file
View File

@ -0,0 +1,7 @@
# Cable: CMake Bootstrap Library.
# Copyright 2019 Pawel Bylica.
# Licensed under the Apache License, Version 2.0.
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS OFF)

View File

@ -0,0 +1,9 @@
# Cable: CMake Bootstrap Library.
# Copyright 2019 Pawel Bylica.
# Licensed under the Apache License, Version 2.0.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

7
toolchains/cxx17.cmake Normal file
View File

@ -0,0 +1,7 @@
# Cable: CMake Bootstrap Library.
# Copyright 2019 Pawel Bylica.
# Licensed under the Apache License, Version 2.0.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS OFF)