IAR: ASM module code deduplication
Introduction
Currently the module Compiler/IAR-ASM.cmake is cluttered with one option for each of the IAR compiler's currently supported architectures.
Suggestion
The code in the module for the IAR Assembler can be deduplicated. Instead of using an else-if branching for each architecture, I suggest we threat all of them based on the IAR's linker technology the toolchain uses.
For the XLINK variant, there is no need to partition the if-elseif just for stablishing a specific assembly extension per architecture.
Instead, we can accept them all. It is unlikely that projects for different CPU architecture targets will ever mix these extensions in the same project. We leave a single comment for clarity. For example:
if("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" IN_LIST _CMAKE_IAR_ITOOLS)
__compiler_iar_ilink(ASM)
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa)
elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" IN_LIST _CMAKE_IAR_XTOOLS)
__compiler_iar_xlink(ASM)
# AVR=s90, MSP430=s43, V850=s85, 8051=s51
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s90;s43;s85;s51;asm;msa)
Please let me know if this suggested fix is eligible for a MR. I have a feature branch ready.