summaryrefslogtreecommitdiff
path: root/Modules/Compiler/IAR-C.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/Compiler/IAR-C.cmake')
-rw-r--r--Modules/Compiler/IAR-C.cmake8
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/Compiler/IAR-C.cmake b/Modules/Compiler/IAR-C.cmake
index cb10020047..af5874ce19 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,13 +20,17 @@ 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()
# Architecture specific
if("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
+ if(CMAKE_C_COMPILER_VERSION_INTERNAL VERSION_LESS 7)
+ # IAR ARM 4.X uses xlink.exe, detection is not yet implemented
+ message(FATAL_ERROR "CMAKE_C_COMPILER_VERSION = ${CMAKE_C_COMPILER_VERSION} not supported by CMake.")
+ endif()
__compiler_iar_ilink(C)
__compiler_check_default_language_standard(C 1.10 90 6.10 99 8.10 11)