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

fix(build): update GCC and CMake checker #1041

Merged
merged 2 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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