|
4 | 4 | # CMake file for cpp-ethereum project which specifies our compiler settings |
5 | 5 | # for each supported platform and build configuration. |
6 | 6 | # |
7 | | -# See http://www.ethdocs.org/en/latest/ethereum-clients/cpp-ethereum/. |
| 7 | +# The documentation for cpp-ethereum is hosted at http://cpp-ethereum.org |
8 | 8 | # |
9 | 9 | # Copyright (c) 2014-2016 cpp-ethereum contributors. |
10 | 10 | #------------------------------------------------------------------------------ |
|
14 | 14 | # |
15 | 15 | # These settings then end up spanning all POSIX platforms (Linux, OS X, BSD, etc) |
16 | 16 |
|
17 | | -include(CheckCXXCompilerFlag) |
| 17 | +include(EthCheckCXXCompilerFlag) |
18 | 18 |
|
19 | | -check_cxx_compiler_flag(-fstack-protector-strong have_stack_protector_strong) |
20 | | -if (have_stack_protector_strong) |
21 | | - add_compile_options(-fstack-protector-strong) |
22 | | -else() |
23 | | - check_cxx_compiler_flag(-fstack-protector have_stack_protector) |
24 | | - if(have_stack_protector) |
25 | | - add_compile_options(-fstack-protector) |
26 | | - endif() |
| 19 | +eth_add_cxx_compiler_flag_if_supported(-fstack-protector-strong have_stack_protector_strong_support) |
| 20 | +if(NOT have_stack_protector_strong_support) |
| 21 | + eth_add_cxx_compiler_flag_if_supported(-fstack-protector) |
27 | 22 | endif() |
28 | 23 |
|
| 24 | +eth_add_cxx_compiler_flag_if_supported(-Wimplicit-fallthrough) |
| 25 | + |
29 | 26 | if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")) |
30 | 27 |
|
31 | 28 | # Use ISO C++11 standard language. |
@@ -83,12 +80,6 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA |
83 | 80 | message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.7 or greater.") |
84 | 81 | endif () |
85 | 82 |
|
86 | | - # Until https://github.com/ethereum/solidity/issues/2479 is handled |
87 | | - # disable all implicit fallthrough warnings in the codebase for GCC > 7.0 |
88 | | - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) |
89 | | - add_compile_options(-Wno-implicit-fallthrough) |
90 | | - endif() |
91 | | - |
92 | 83 | # Additional Clang-specific compiler settings. |
93 | 84 | elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") |
94 | 85 |
|
|
0 commit comments