Skip to content

Commit

Permalink
Verify minimal clang version in cmake.
Browse files Browse the repository at this point in the history
  • Loading branch information
ekpyron committed Dec 10, 2020
1 parent c400c61 commit 4cb9a42
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmake/EthCompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,8 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA

# Additional GCC-specific compiler settings.
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")

# Check that we've got GCC 8.0 or newer.
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if (NOT (GCC_VERSION VERSION_GREATER 8.0 OR GCC_VERSION VERSION_EQUAL 8.0))
if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0))
message(FATAL_ERROR "${PROJECT_NAME} requires g++ 8.0 or greater.")
endif ()

Expand All @@ -78,6 +75,11 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA

# Additional Clang-specific compiler settings.
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
# Check that we've got clang 7.0 or newer.
if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0))
message(FATAL_ERROR "${PROJECT_NAME} requires clang++ 7.0 or greater.")
endif ()

if ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
# Set stack size to 32MB - by default Apple's clang defines a stack size of 8MB.
# Normally 16MB is enough to run all tests, but it will exceed the stack, if -DSANITIZE=address is used.
Expand Down

0 comments on commit 4cb9a42

Please sign in to comment.