From d8e6cd9ed8bfee9073cff26cb654bc01e653b0b9 Mon Sep 17 00:00:00 2001 From: Norbert Lange Date: Thu, 15 Jun 2017 14:50:22 +0200 Subject: 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 --- Modules/CMakeDetermineASMCompiler.cmake | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Modules/CMakeDetermineASMCompiler.cmake') diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index b4779bf96d..d031421762 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -103,8 +103,23 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) include(CMakeDetermineCompilerId) set(userflags) CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT} "${userflags}") + if("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}" STREQUAL "IAR") + # primary necessary to detect architecture, so the right archiver and linker can be picked + # eg. IAR Assembler V8.10.1.12857/W32 for ARM + # 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}) + endif() + endif() + unset(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_OUTPUT) + 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}") @@ -149,6 +164,9 @@ endif () include(CMakeFindBinUtils) +set(_CMAKE_PROCESSING_LANGUAGE "ASM") +include(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-FindBinUtils OPTIONAL) +unset(_CMAKE_PROCESSING_LANGUAGE) set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR "ASM${ASM_DIALECT}") -- cgit v1.2.1