From ded68b9af733005499fbe7d6e9c188fa7c7e1d0b Mon Sep 17 00:00:00 2001 From: Davis King Date: Wed, 28 Apr 2021 08:05:22 -0400 Subject: [PATCH] Cleanup gcc version checking code a little. Also fix this error from cmake 3.5.1: ``` CMake Error at CMakeLists.txt:62 (if): if given arguments: "CMAKE_COMPILER_IS_GNUCXX" "AND" "CMAKE_CXX_COMPILER_VERSION" "VERSION_LESS_EQUAL" "4.8.5" Unknown arguments specified ``` --- dlib/CMakeLists.txt | 5 ----- dlib/cmake_utils/set_compiler_specific_options.cmake | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/dlib/CMakeLists.txt b/dlib/CMakeLists.txt index fd266f84a..96a1db673 100644 --- a/dlib/CMakeLists.txt +++ b/dlib/CMakeLists.txt @@ -58,11 +58,6 @@ if(has_parent) endif() endif() -# As of dlib 19.22, GCC 4.8.5 is no longer supported, building will fail, so let users know. -if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 4.8.5) - message(FATAL_ERROR "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_VERSION} is too old for dlib ${VERSION}.\n\ - Either update your compiler to be fully compliant with C++11 or build an older version of dlib, such as 19.21.") -endif() if (COMMAND pybind11_add_module AND MSVC) # True when building a python extension module using Visual Studio. We care diff --git a/dlib/cmake_utils/set_compiler_specific_options.cmake b/dlib/cmake_utils/set_compiler_specific_options.cmake index 7004333be..e4d426b73 100644 --- a/dlib/cmake_utils/set_compiler_specific_options.cmake +++ b/dlib/cmake_utils/set_compiler_specific_options.cmake @@ -46,8 +46,8 @@ endif() if(CMAKE_COMPILER_IS_GNUCXX) execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) - if (GCC_VERSION VERSION_LESS 4.8) - message(FATAL_ERROR "C++11 is required to use dlib, but the version of GCC you are using is too old and doesn't support C++11. You need GCC 4.8 or newer. ") + if (GCC_VERSION VERSION_LESS 4.9) + message(FATAL_ERROR "C++11 is required to use dlib, but the version of GCC you are using is too old and doesn't support C++11. You need GCC 4.9 or newer. ") endif() endif()