File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Toolchain File for the IAR C/C++ Compiler (CX)
2+
3+ # Set CMake for cross-compiling
4+ set (CMAKE_SYSTEM_NAME Generic)
5+
6+ # Set CMake to use the IAR C/C++ Compiler from the IAR Build Tools for Arm
7+ # Update if using a different supported target or operating system
8+ set (CMAKE_ASM_COMPILER /opt/iar/cxarm/arm/bin/iasmarm)
9+ set (CMAKE_C_COMPILER /opt/iar/cxarm/arm/bin/iccarm)
10+ set (CMAKE_CXX_COMPILER /opt/iar/cxarm/arm/bin/iccarm)
11+
12+ # Avoids running the linker during try_compile()
13+ set (CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
14+
15+ # Set the default build tool for Ninja gnerators
16+ # Reasonably recent IAR products ships with ninja (https://ninja-build.org)
17+ # The CMake code block below tries to find it. If not found,
18+ # manually install the desired build system in your operating system
19+ # Alternatively: set(CMAKE_MAKE_PROGRAM "/usr/bin/ninja")
20+ if (CMAKE_GENERATOR MATCHES "^Ninja.*$" )
21+ find_program (CMAKE_MAKE_PROGRAM
22+ NAMES ninja
23+ PATHS $ENV{PATH}
24+ /opt/iar/cxarm/common/bin
25+ REQUIRED )
26+ endif ()
You can’t perform that action at this time.
0 commit comments