diff options
author | Brad King <brad.king@kitware.com> | 2019-05-01 16:40:47 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-01 16:42:29 (GMT) |
commit | fb325daa55b1bd6aa2b2b7f2c615214378224938 (patch) | |
tree | 16da7c4e8ffa58a0ed5c367e0129b556508fb25c | |
parent | 13b73ff65f2a6107f1257bac92df94fed31c25f8 (diff) | |
parent | 4d78bea5dfa53958a1317f655b1e761e457a54c7 (diff) | |
download | CMake-fb325daa55b1bd6aa2b2b7f2c615214378224938.zip CMake-fb325daa55b1bd6aa2b2b7f2c615214378224938.tar.gz CMake-fb325daa55b1bd6aa2b2b7f2c615214378224938.tar.bz2 |
Merge topic 'IAR_6_x_fix'
4d78bea5df IAR: Fail early in case of IAR ARM 4.XX
0b684524ac IAR: Fix building with IAR ARM 6.X
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3263
-rw-r--r-- | Modules/Compiler/IAR-C.cmake | 8 | ||||
-rw-r--r-- | Modules/Compiler/IAR-CXX.cmake | 7 |
2 files changed, 12 insertions, 3 deletions
diff --git a/Modules/Compiler/IAR-C.cmake b/Modules/Compiler/IAR-C.cmake index cb10020..af5874c 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) diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake index eb27e3c..04ccbe5 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++) @@ -33,6 +34,10 @@ endif() # Architecture specific if("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM") + if(CMAKE_CXX_COMPILER_VERSION_INTERNAL VERSION_LESS 7) + # IAR ARM 4.X uses xlink.exe, detection is not yet implemented + message(FATAL_ERROR "CMAKE_CXX_COMPILER_VERSION = ${CMAKE_C_COMPILER_VERSION} not supported by CMake.") + endif() __compiler_iar_ilink(CXX) __compiler_check_default_language_standard(CXX 6.10 98 8.10 14) |