From 63bf01a60a3a0388e47a85d7bab1948473526426 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Mon, 22 Jun 2020 03:18:54 +0300 Subject: [PATCH] mdbx-cmake: fix for e2k-lcc 1.24 Change-Id: I5827d4a2526886ae37ad6fe342d5955594081b84 --- cmake/compiler.cmake | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake index 544a22d9..61d7b3f0 100644 --- a/cmake/compiler.cmake +++ b/cmake/compiler.cmake @@ -73,23 +73,6 @@ if(CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID MATCHES ".*[Cc][Ll][Aa][N set(CMAKE_COMPILER_IS_GNUCXX OFF) endif() -# Hard coding the compiler version is ugly from cmake POV, but -# at least gives user a friendly error message. The most critical -# demand for C++ compiler is support of C++11 lambdas, added -# only in version 4.5 https://gcc.gnu.org/projects/cxx0x.html -if(CMAKE_COMPILER_IS_GNUCC) - if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) - message(FATAL_ERROR " - Your GCC version is ${CMAKE_C_COMPILER_VERSION}, please update") - endif() -endif() -if(CMAKE_COMPILER_IS_GNUCXX) - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5) - message(FATAL_ERROR " - Your G++ version is ${CMAKE_CXX_COMPILER_VERSION}, please update") - endif() -endif() - if(CMAKE_C_COMPILER_LOADED) # Check for Elbrus lcc execute_process(COMMAND ${CMAKE_C_COMPILER} --version @@ -138,6 +121,25 @@ if(CMAKE_CXX_COMPILER_LOADED) unset(tmp_lxx_probe_result) endif() +# Hard coding the compiler version is ugly from cmake POV, but +# at least gives user a friendly error message. The most critical +# demand for C++ compiler is support of C++11 lambdas, added +# only in version 4.5 https://gcc.gnu.org/projects/cxx0x.html +if(CMAKE_COMPILER_IS_GNUCC) + if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5 + AND NOT CMAKE_COMPILER_IS_ELBRUSC) + message(FATAL_ERROR " + Your GCC version is ${CMAKE_C_COMPILER_VERSION}, please update") + endif() +endif() +if(CMAKE_COMPILER_IS_GNUCXX) + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5 + AND NOT CMAKE_COMPILER_IS_ELBRUSCXX) + message(FATAL_ERROR " + Your G++ version is ${CMAKE_CXX_COMPILER_VERSION}, please update") + endif() +endif() + if(CMAKE_CL_64) set(MSVC64 1) endif()