IAR Compiler support is lacking
Hello,
I am using CMake together with GCC and IAR and am trying to make it mostly painless to switch between those compilers. IAR support seems lacking however.
- Assembler "iasmarm" is not automatically detected
- C and C++ Compiler are one executable "iccarm", C++ mode is enabled with --c++ Flag. enabling this via *FLAGS is kinda sketchy, would probably be best to
set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> --c++ <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
- The tool ielftool would be nice to have as Variable, its necessary for converting elf to binary.
find_program(CMAKE_IAR_ELFTOOL ielftool HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" "${_CMAKE_ASM_TOOLCHAIN_LOCATION}")
- Useful flags for the default configurations are missing
I am aware that I will have to set own flags for embedded development, but those are some things that should be supported directly, particularly because I shouldn`t be using those internal variables.
As for default configurations, these would be sensible I believe:
foreach(lang C CXX) string(APPEND CMAKE_${lang}_FLAGS " ") string(APPEND CMAKE_${lang}_FLAGS_DEBUG " -r") string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL " -Ohz -DNDEBUG") string(APPEND CMAKE_${lang}_FLAGS_RELEASE " -Oh -DNDEBUG") string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO " -Om -r -DNDEBUG") endforeach(lang)