From 0b684524ac657b03ea233e039aad5c8e43a52f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 25 Apr 2019 15:04:26 +0200 Subject: IAR: Fix building with IAR ARM 6.X Use the correct version macros and version numbers. --- Modules/Compiler/IAR-C.cmake | 4 ++-- Modules/Compiler/IAR-CXX.cmake | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Modules/Compiler/IAR-C.cmake b/Modules/Compiler/IAR-C.cmake index cb10020..d19b502 100644 --- a/Modules/Compiler/IAR-C.cmake +++ b/Modules/Compiler/IAR-C.cmake @@ -10,7 +10,7 @@ endif() set(CMAKE_C_EXTENSION_COMPILE_OPTION -e) -if(CMAKE_CXX_COMPILER_VERSION_INTERNAL VERSION_GREATER 7) +if(CMAKE_C_COMPILER_VERSION_INTERNAL VERSION_GREATER 7) set(CMAKE_C90_STANDARD_COMPILE_OPTION --c89) set(CMAKE_C90_EXTENSION_COMPILE_OPTION --c89 -e) set(CMAKE_C99_STANDARD_COMPILE_OPTION "") @@ -20,7 +20,7 @@ elseif() set(CMAKE_C90_EXTENSION_COMPILE_OPTION -e) endif() -if(CMAKE_CXX_COMPILER_VERSION_INTERNAL VERSION_GREATER 8) +if(CMAKE_C_COMPILER_VERSION_INTERNAL VERSION_GREATER 8) set(CMAKE_C11_STANDARD_COMPILE_OPTION "") set(CMAKE_C11_EXTENSION_COMPILE_OPTION -e) endif() diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake index eb27e3c..b338de8 100644 --- a/Modules/Compiler/IAR-CXX.cmake +++ b/Modules/Compiler/IAR-CXX.cmake @@ -8,7 +8,8 @@ if(NOT CMAKE_IAR_CXX_FLAG) if(NOT CMAKE_CXX_COMPILER_VERSION) message(FATAL_ERROR "CMAKE_CXX_COMPILER_VERSION not detected. This should be automatic.") endif() - if(CMAKE_CXX_COMPILER_VERSION_INTERNAL VERSION_GREATER 8) + + if(CMAKE_CXX_COMPILER_VERSION_INTERNAL VERSION_GREATER 7) set(CMAKE_IAR_CXX_FLAG --c++) else() set(CMAKE_IAR_CXX_FLAG --eec++) -- cgit v0.12