diff options
author | Brad King <brad.king@kitware.com> | 2022-11-14 15:15:38 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-11-14 15:15:56 (GMT) |
commit | 6495e7e55555ad6d191973699dac47683a2a84da (patch) | |
tree | 50563d6e5ce55be79a47727ae6b7515134b40f33 /Modules | |
parent | f3d2e3f95da2c72f49c1e620d5e2350c3ac36b14 (diff) | |
parent | f9ff6ab2d105e1a40b79ac93a70fe3658b2736f9 (diff) | |
download | CMake-6495e7e55555ad6d191973699dac47683a2a84da.zip CMake-6495e7e55555ad6d191973699dac47683a2a84da.tar.gz CMake-6495e7e55555ad6d191973699dac47683a2a84da.tar.bz2 |
Merge topic 'iar-asm-archid'
f9ff6ab2d1 IAR: Fix ASM compiler architecture detection
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7903
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineASMCompiler.cmake | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index d03cbef..5ec2972 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -129,14 +129,13 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) if("x${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}" STREQUAL "xIAR") # primary necessary to detect architecture, so the right archiver and linker can be picked # eg. "IAR Assembler V8.10.1.12857/W32 for ARM" or "IAR Assembler V4.11.1.4666 for Renesas RX" - # Cut out identification first, newline handling is a pain + # Earlier versions did not provide `--version`, so grep the full output to extract Assembler ID string string(REGEX MATCH "IAR Assembler[^\r\n]*" _compileid "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_OUTPUT}") if("${_compileid}" MATCHES "V([0-9]+\\.[0-9]+\\.[0-9]+)") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_VERSION ${CMAKE_MATCH_1}) endif() - string(REGEX MATCHALL "([A-Za-z0-9-]+)" _all_compileid_matches "${_compileid}") - if(_all_compileid_matches) - list(GET _all_compileid_matches "-1" CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID) + if("${_compileid}" MATCHES "for.*(MSP430|8051|ARM|AVR|RH850|RISC-?V|RL78|RX|STM8|V850)") + set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID ${CMAKE_MATCH_1}) endif() elseif("x${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}" STREQUAL "xClang") # Test whether an MSVC-like command-line option works. |