diff options
author | Micael Borgefeldt <micael.borgefeldt@iar.com> | 2019-10-11 12:51:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-10-11 14:22:52 (GMT) |
commit | 5652e11ea1543a9d3038bf104607bf13feb5582a (patch) | |
tree | c870154eabc4bef527b13212bcd05e969dc9f02f /Modules/Compiler | |
parent | 6e51db9a40cda01907322da384a84bf5c4237231 (diff) | |
download | CMake-5652e11ea1543a9d3038bf104607bf13feb5582a.zip CMake-5652e11ea1543a9d3038bf104607bf13feb5582a.tar.gz CMake-5652e11ea1543a9d3038bf104607bf13feb5582a.tar.bz2 |
IAR: Add 8051 support
Issue: #17264
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/IAR-ASM.cmake | 5 | ||||
-rw-r--r-- | Modules/Compiler/IAR-C.cmake | 5 | ||||
-rw-r--r-- | Modules/Compiler/IAR-CXX.cmake | 6 | ||||
-rw-r--r-- | Modules/Compiler/IAR-DetermineCompiler.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/IAR-FindBinUtils.cmake | 3 |
5 files changed, 19 insertions, 2 deletions
diff --git a/Modules/Compiler/IAR-ASM.cmake b/Modules/Compiler/IAR-ASM.cmake index ace7f58..936d4ae 100644 --- a/Modules/Compiler/IAR-ASM.cmake +++ b/Modules/Compiler/IAR-ASM.cmake @@ -42,6 +42,11 @@ elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "V850") __compiler_iar_xlink(ASM) set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s85;asm;msa) +elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "8051") + set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -S <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>") + __compiler_iar_xlink(ASM) + set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s51;asm;msa) + else() message(FATAL_ERROR "CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID not detected. This should be automatic.") endif() diff --git a/Modules/Compiler/IAR-C.cmake b/Modules/Compiler/IAR-C.cmake index 9ad1ba0..e27fdfc 100644 --- a/Modules/Compiler/IAR-C.cmake +++ b/Modules/Compiler/IAR-C.cmake @@ -65,6 +65,11 @@ elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "V850") __compiler_check_default_language_standard(C 1.10 90 4.10 99) set(CMAKE_C_OUTPUT_EXTENSION ".r85") +elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "8051") + __compiler_iar_xlink(C) + __compiler_check_default_language_standard(C 6.10 90 8.10 99) + set(CMAKE_C_OUTPUT_EXTENSION ".r51") + else() message(FATAL_ERROR "CMAKE_C_COMPILER_ARCHITECTURE_ID not detected. This should be automatic.") endif() diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake index 549d242..eca89c5 100644 --- a/Modules/Compiler/IAR-CXX.cmake +++ b/Modules/Compiler/IAR-CXX.cmake @@ -72,6 +72,12 @@ elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "V850") __compiler_iar_xlink(CXX) __compiler_check_default_language_standard(CXX 1.10 98) set(CMAKE_C_OUTPUT_EXTENSION ".r85") + +elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "8051") + __compiler_iar_xlink(CXX) + __compiler_check_default_language_standard(CXX 6.10 98) + set(CMAKE_C_OUTPUT_EXTENSION ".r51") + else() message(FATAL_ERROR "CMAKE_CXX_COMPILER_ARCHITECTURE_ID not detected. This should be automatic." ) endif() diff --git a/Modules/Compiler/IAR-DetermineCompiler.cmake b/Modules/Compiler/IAR-DetermineCompiler.cmake index 7e17778..0a026b2 100644 --- a/Modules/Compiler/IAR-DetermineCompiler.cmake +++ b/Modules/Compiler/IAR-DetermineCompiler.cmake @@ -31,7 +31,7 @@ set(_compiler_id_version_compute " # define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(((__VER__) / 1000) % 1000) # define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@((__VER__) % 1000) # define @PREFIX@COMPILER_VERSION_INTERNAL @MACRO_DEC@(__IAR_SYSTEMS_ICC__) -# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__)) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) # define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@((__VER__) / 100) # define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@((__VER__) - (((__VER__) / 100)*100)) # define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__SUBVERSION__) diff --git a/Modules/Compiler/IAR-FindBinUtils.cmake b/Modules/Compiler/IAR-FindBinUtils.cmake index 6258cf3..6ef3759 100644 --- a/Modules/Compiler/IAR-FindBinUtils.cmake +++ b/Modules/Compiler/IAR-FindBinUtils.cmake @@ -46,7 +46,8 @@ set(CMAKE_IAR_LINKER \"${CMAKE_IAR_LINKER}\") elseif("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR" OR "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430" OR - "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "V850") + "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "V850" OR + "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "8051") # Find the "xlink" linker and "xar" archiver: find_program(CMAKE_IAR_LINKER xlink HINTS ${__iar_hints} |