IAR-FindBinUtils.cmake not compatible with IAR build tools for Linux
IAR now provides build tools for Linux, e.g. these ones for ARM https://www.iar.com/products/architectures/arm/iar-build-tools-for-linux-for-arm/
Our existing CMake files (based on IAR tools for Windows) mostly work out of the box, the only issue is that the various utilities (ielftool
, iarchive
) are not found. It seems to me that they are defined here: https://gitlab.kitware.com/cmake/cmake/-/blob/f0c84346ed25f6b8ce3a9f79aece87a58c8a4748/Modules/Compiler/IAR-FindBinUtils.cmake and the problem is that it tries to find e.g. iarchive.exe
instead of just iarchive
. I'm not sure if the .exe is even needed on Windows, it works fine without for me.
A workaround is to add the following lines prior to any enable_language
/project
statements:
find_program(CMAKE_IAR_LINKARM ilinkarm)
find_program(CMAKE_IAR_ARCHIVE iarchive)
find_program(CMAKE_IAR_ELFDUMP ielfdumparm)
find_program(CMAKE_IAR_ELFTOOL ielftool)
find_program(CMAKE_IAR_OBJMANIP iobjmanip)
find_program(CMAKE_IAR_SYMEXPORT isymexport)