diff options
author | Norbert Lange <nolange79@gmail.com> | 2017-06-15 12:50:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-06-29 17:25:58 (GMT) |
commit | d8e6cd9ed8bfee9073cff26cb654bc01e653b0b9 (patch) | |
tree | 97832d5147c8ea16bf64e3ca53a9a927dd3f40c6 /Modules/Compiler/IAR-ASM.cmake | |
parent | 0b1a2876c817a00daf7027570b1976a9e15ff654 (diff) | |
download | CMake-d8e6cd9ed8bfee9073cff26cb654bc01e653b0b9.zip CMake-d8e6cd9ed8bfee9073cff26cb654bc01e653b0b9.tar.gz CMake-d8e6cd9ed8bfee9073cff26cb654bc01e653b0b9.tar.bz2 |
IAR: Improve support for IAR ARM Compiler
Make the implementation for this compiler more complete.
IAR has multiple C++ modes, historically they were reduced c++ versions
for embedded that gradually improved to the full standard (which can be
reduced again by e.g. disabling rtti and exceptions). The new
implementation picks the best available, but the c++ mode can also be
overridden by defining `CMAKE_IAR_CXX_FLAG`.
Add C/C++ standard flags so that all modes up to and including the last
supported standard are defined.
Fixes: #16826
Diffstat (limited to 'Modules/Compiler/IAR-ASM.cmake')
-rw-r--r-- | Modules/Compiler/IAR-ASM.cmake | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Modules/Compiler/IAR-ASM.cmake b/Modules/Compiler/IAR-ASM.cmake index 844c30e..651bc3a 100644 --- a/Modules/Compiler/IAR-ASM.cmake +++ b/Modules/Compiler/IAR-ASM.cmake @@ -2,13 +2,20 @@ include(Compiler/IAR) -set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>") - -if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "ARM") +if("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM") +set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -S <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>") + __compiler_iar_ARM(ASM) set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa) -endif() + string(APPEND CMAKE_ASM_FLAGS_INIT " ") + string(APPEND CMAKE_ASM_FLAGS_DEBUG_INIT " -r") + string(APPEND CMAKE_ASM_FLAGS_MINSIZEREL_INIT " -DNDEBUG") + string(APPEND CMAKE_ASM_FLAGS_RELEASE_INIT " -DNDEBUG") + string(APPEND CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT " -r -DNDEBUG") -if("${IAR_TARGET_ARCHITECTURE}" STREQUAL "AVR") +elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR") + set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -S <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>") + __compiler_iar_AVR(ASM) set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s90;asm;msa) + endif() |