diff --git a/cmake/EthCheckCXXCompilerFlag.cmake b/cmake/EthCheckCXXCompilerFlag.cmake deleted file mode 100644 index 3e62885fe..000000000 --- a/cmake/EthCheckCXXCompilerFlag.cmake +++ /dev/null @@ -1,25 +0,0 @@ -include(CheckCXXCompilerFlag) - -# Adds CXX compiler flag if the flag is supported by the compiler. -# -# This is effectively a combination of CMake's check_cxx_compiler_flag() -# and add_compile_options(): -# -# if(check_cxx_compiler_flag(flag)) -# add_compile_options(flag) -# -function(eth_add_cxx_compiler_flag_if_supported FLAG) - # Remove leading - or / from the flag name. - string(REGEX REPLACE "^[-/]" "" name ${FLAG}) - # Deletes any ':' because it's invalid variable names. - string(REGEX REPLACE ":" "" name ${name}) - check_cxx_compiler_flag(${FLAG} ${name}) - if(${name}) - add_compile_options(${FLAG}) - endif() - - # If the optional argument passed, store the result there. - if(ARGV1) - set(${ARGV1} ${name} PARENT_SCOPE) - endif() -endfunction() diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index 2461b947d..935097978 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -15,13 +15,9 @@ # These settings then end up spanning all POSIX platforms (Linux, OS X, BSD, etc) include(CableCompileOptions) -include(EthCheckCXXCompilerFlag) if(NOT EMSCRIPTEN) - eth_add_cxx_compiler_flag_if_supported(-fstack-protector-strong have_stack_protector_strong_support) - if(NOT have_stack_protector_strong_support) - eth_add_cxx_compiler_flag_if_supported(-fstack-protector) - endif() + cable_add_compile_options(IF_SUPPORTED -fstack-protector -fstack-protector-strong) endif() if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))