[cmake-developers] Add support for IAR compilers
Alexander Neundorf
neundorf at kde.org
Sun Oct 17 10:17:54 EDT 2010
Hi,
basically since January this year I am busy with adding support for the IAR
compilers to cmake:
http://public.kitware.com/Bug/view.php?id=10176
Main problem is that they run only under Windows, I don't have Windows, and I
also already tried to get them installed on a ReactOS QEmu image, but didn't
succeed, in the end some things didn't work.
I think it should be 90 to 95% done, and from what I get from the emails of
the two people who'd like to use it the only thing remaining is how to escape
the "--dblib_config" switch (see attached toolchain file) properly, so the
whitespace is handled properly.
But somehow progress is quite slow, and the reply emails I get are not always
completely satisfying...
So, I pushed what I have so far now to staging, and it would be nice if
somebody from you with a Windows machine could give it a try:
http://cmake.org/gitweb?p=stage/cmake.git;a=shortlog;h=refs/heads/AddIARSupport
The compiler can be downloaded here, after registering (for free):
http://supp.iar.com/Download/SW/?item=EWARM-EVAL
(I did that already, but didn't get it running under ReactOS in QEmu).
I have a hello-world like example project here, which I could send you for
testing.
Alex
-------------- next part --------------
# ================================================================================================
# STM32_ToolchainCmake_Force.txt
# This is the toolchain file for STM32 famliy using IAR compiler and No OS.
# ================================================================================================
# This project started with CMake 2.8.2
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR STM32 )
set(CPU_VARIANT STM32F103
CACHE STRING "Choose a member of STM32 Family" )
# ------ Compiling --------
set(COMPILER_PATH "D:/Program Files/IAR Systems/Embedded Workbench 5.5" )
set(CMAKE_C_COMPILER ${COMPILER_PATH}/arm/bin/iccarm.exe )
set(CMAKE_CXX_COMPILER ${COMPILER_PATH}/arm/bin/iccarm.exe -eec++ )
set(CMAKE_ASM_COMPILER ${COMPILER_PATH}/arm/bin/iasmarm.exe)
set(DLIBS "--dlib_config \"${COMPILER_PATH}/arm/inc/DLib_Config_Full.h\"")
#set(DLIBS "--dlib_config \"D:/Program Files/IAR Systems/Embedded Workbench 5.5/arm/inc/DLib_Config_Full.h\"")
set(CMAKE_C_FLAGS_INIT "--silent --endian=little --cpu=Cortex-M3 -e --fpu=None --dlib_config \\\"D:/Program Files/IAR Systems/Embedded Workbench 5.5/arm/inc/DLib_Config_Full.h\\\" ")
set(CMAKE_CXX_FLAGS_INIT "--silent --endian=little --cpu=Cortex-M3 -e --fpu=None --dlib_config \\\"D:/Program Files/IAR Systems/Embedded Workbench 5.5/arm/inc/DLib_Config_Full.h\\\" ")
# I guess these are necessary for compiling anything ?
include_directories(
${COMPILER_PATH}/arm/inc
${COMPILER_PATH}/arm/inc/st
)
# ------ Linking --------
set(link_file_icf "D:/Src/Embedded/KNX/stm32_knx_device/v1.0.0.0/etc/workspace/make/stm32f10x_flash.icf")
# Is this the absolute minimum set of options necessary for linking ?
set(CMAKE_EXE_LINKER_FLAGS
"--config ${link_file_icf} --redirect _Scanf=_ScanfSmall --map ${PROJECT_NAME}.map --entry __iar_program_start "
)
# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
More information about the cmake-developers
mailing list