diff options
author | Ethan Slattery <theslat@gmail.com> | 2019-01-11 01:26:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-15 18:59:01 (GMT) |
commit | 270965e0c7dadccc3564f7ab825cd4e618a15e42 (patch) | |
tree | 4efc9ab5a28f6554a9b8fe037a0861cd1a976676 /Modules/Compiler/IAR-CXX.cmake | |
parent | 7414d422b267718e737637fefa01b94502febb0e (diff) | |
download | CMake-270965e0c7dadccc3564f7ab825cd4e618a15e42.zip CMake-270965e0c7dadccc3564f7ab825cd4e618a15e42.tar.gz CMake-270965e0c7dadccc3564f7ab825cd4e618a15e42.tar.bz2 |
IAR: Update compiler modules to support AVR systems
Fixes: #18557
Diffstat (limited to 'Modules/Compiler/IAR-CXX.cmake')
-rw-r--r-- | Modules/Compiler/IAR-CXX.cmake | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake index 5b783b2..b7076f5 100644 --- a/Modules/Compiler/IAR-CXX.cmake +++ b/Modules/Compiler/IAR-CXX.cmake @@ -38,7 +38,27 @@ if("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM") __compiler_check_default_language_standard(CXX 6.10 98 8.10 14) elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR") + # "embedded C++" --EC++ is probably closest to CXX98 but with no support for: + # Templates, multiple inheritance, virtual inheritance, exceptions, RTTI, C++ style casts, + # Namespaces, the mutable attribute, no STL, any library features related to the above features. + # + # "(extended) embedded C++" --EEC++ Mode but DOES NOT support any normal C++ standard + # probably closest to CXX98 but with no RTTI and no exceptions, and the library + # provided is not in the standard namespace + if(NOT CMAKE_IAR_CXX_FLAG) + if(NOT CMAKE_CXX_COMPILER_VERSION) + message(FATAL_ERROR "CMAKE_CXX_COMPILER_VERSION not detected. This should be automatic.") + endif() + set(CMAKE_IAR_CXX_FLAG --eec++) + endif() + + set(CMAKE_CXX_EXTENSION_COMPILE_OPTION -e) + set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "") + set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION -e) + __compiler_iar_AVR(CXX) + __compiler_check_default_language_standard(CXX 7.10 98) + set(CMAKE_CXX_OUTPUT_EXTENSION ".r90") if(NOT CMAKE_CXX_LINK_FLAGS) set(CMAKE_CXX_LINK_FLAGS "-Fmotorola") @@ -51,6 +71,7 @@ elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR") get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH) get_filename_component(_compilerDir "${_compilerDir}" PATH) include_directories("${_compilerDir}/inc") + include_directories("${_compilerDir}/inc/Atmel") else() message(FATAL_ERROR "CMAKE_CXX_COMPILER_ARCHITECTURE_ID not detected as \"AVR\" or \"ARM\". This should be automatic." ) |