From 5f6516a19acd821b9bfb37321bfa257b8cca323d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 26 Apr 2024 21:36:59 +1000 Subject: [PATCH] CMake: differentiate between C/C++ compiler versions in errors In case C/C++ compiler versions differ, it's best to report which is outdated. --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5960b692b92..7dd796123f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,24 +120,24 @@ enable_testing() if(CMAKE_COMPILER_IS_GNUCC) if("${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "11.0.0") message(FATAL_ERROR "\ -The minimum supported version of GCC is 11.0.0, found ${CMAKE_C_COMPILER_VERSION}" +The minimum supported version of GCC is 11.0.0, found C compiler: ${CMAKE_C_COMPILER_VERSION}" ) endif() if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "11.0.0") message(FATAL_ERROR "\ -The minimum supported version of GCC is 11.0.0, found ${CMAKE_CXX_COMPILER_VERSION}" +The minimum supported version of GCC is 11.0.0, found C++ compiler${CMAKE_CXX_COMPILER_VERSION}" ) endif() elseif(CMAKE_C_COMPILER_ID MATCHES "Clang") if(CMAKE_COMPILER_IS_GNUCC) if("${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "8.0") message(FATAL_ERROR "\ -The minimum supported version of CLANG is 8.0, found ${CMAKE_C_COMPILER_VERSION}" +The minimum supported version of CLANG is 8.0, found C compiler ${CMAKE_C_COMPILER_VERSION}" ) endif() if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "8.0") message(FATAL_ERROR "\ -The minimum supported version of CLANG is 8.0, found ${CMAKE_CXX_COMPILER_VERSION}" +The minimum supported version of CLANG is 8.0, found C++ compiler ${CMAKE_CXX_COMPILER_VERSION}" ) endif() endif()