diff options
author | Stefan Andersson <tfosm@hotmail.com> | 2019-04-05 09:50:59 (GMT) |
---|---|---|
committer | Stefan Andersson <tfosm@hotmail.com> | 2019-04-12 07:10:02 (GMT) |
commit | ea83d0f8fb8fd6806c4d5f32e0392638ddc3b65e (patch) | |
tree | 1640a28ff8cc7d50d7a043decb5c948e918e563a /Modules/CMakeDetermineASMCompiler.cmake | |
parent | 52fb35bd69ec2fa1a5307695cb22c3f125debf4f (diff) | |
download | CMake-ea83d0f8fb8fd6806c4d5f32e0392638ddc3b65e.zip CMake-ea83d0f8fb8fd6806c4d5f32e0392638ddc3b65e.tar.gz CMake-ea83d0f8fb8fd6806c4d5f32e0392638ddc3b65e.tar.bz2 |
IAR: Generalize and add support for IAR RX compiler
Moved common ASM setup to the common macros and changed version check.
Diffstat (limited to 'Modules/CMakeDetermineASMCompiler.cmake')
-rw-r--r-- | Modules/CMakeDetermineASMCompiler.cmake | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index b8c8c5d..eabb8b5 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -119,35 +119,40 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT} "${userflags}") 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 + # 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 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() - if("${_compileid}" MATCHES "for[ ]+([A-Za-z0-9]+)") - set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID ${CMAKE_MATCH_1}) + 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) endif() endif() unset(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_OUTPUT) + unset(_all_compileid_matches) unset(_compileid) endif() - if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) if(CMAKE_ASM${ASM_DIALECT}_COMPILER_VERSION) set(_version " ${CMAKE_ASM${ASM_DIALECT}_COMPILER_VERSION}") else() set(_version "") endif() - message(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}${_version}") + if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID) + set(_archid " ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}") + else() + set(_archid "") + endif() + message(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}${_archid}${_version}") + unset(_archid) unset(_version) else() message(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown") endif() - - # If we have a gas/as cross compiler, they have usually some prefix, like # e.g. powerpc-linux-gas, arm-elf-gas or i586-mingw32msvc-gas , optionally # with a 3-component version number at the end |