Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
fix(build): update GCC and CMake checker (#1041)
Browse files Browse the repository at this point in the history
  • Loading branch information
Smityz authored Feb 14, 2022
1 parent 8c310b9 commit 89dc34f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
cmake_minimum_required(VERSION 3.5.2)
cmake_minimum_required(VERSION 3.11.0)

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# require at least gcc 5.4.0
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.4.0)
message(FATAL_ERROR "GCC version must be at least 5.4.0!")
endif ()
endif ()

project(dsn C CXX)

Expand Down
4 changes: 2 additions & 2 deletions bin/dsn.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ function(dsn_setup_compiler_flags)
# add sanitizer check
if(DEFINED SANITIZER)
if(NOT (("${COMPILER_FAMILY}" STREQUAL "clang") OR
("${COMPILER_FAMILY}" STREQUAL "gcc" AND "${COMPILER_VERSION}" VERSION_GREATER "4.8")))
message(SEND_ERROR "Cannot use sanitizer without clang or gcc >= 4.8")
("${COMPILER_FAMILY}" STREQUAL "gcc" AND "${COMPILER_VERSION}" VERSION_GREATER "5.4.0")))
message(SEND_ERROR "Cannot use sanitizer without clang or gcc >= 5.4.0")
endif()

message(STATUS "Running cmake with sanitizer=${SANITIZER}")
Expand Down
8 changes: 4 additions & 4 deletions thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
##############################################################################

project(pegasus_thirdparties)
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.11.0)

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# require at least gcc 4.8
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
message(FATAL_ERROR "GCC version must be at least 4.8!")
# require at least gcc 5.4.0
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.4.0)
message(FATAL_ERROR "GCC version must be at least 5.4.0!")
endif ()
endif ()

Expand Down

0 comments on commit 89dc34f

Please sign in to comment.