-
Notifications
You must be signed in to change notification settings - Fork 19
IAR ILINK linker options in a CMake Project
The IAR ILINK Linker comes with a vast amount of options that are described in detail in its accompanying Development Guide. Below you will find a non-exhaustive compendium of frequently used options, alongside their respective meanings, where and how you can use them in your CMake projects.
Some linker options are available regardless of the chosen target architecture. Below you will find relevant information. In CMake, all linker options can be specified in In CMake, this option can be specified in target_link_options().
-
--config <file>.icfreads the linker configuration from<file>.icf. -
--map <file>|<dir>produces a linker map file in the chosen location. Example:
target_link_options(tgt PRIVATE
--map . # will generate a map file inside ${CMAKE_CURRENT_BUILD_DIR}
# other linker options... )-
--no_wrap_diagnosticsprevents line breaks for linker-related diagnostic messages. In CMake, it is a recommended option for environments where these messages will be logged. -
--redirect=<foo>=<alt_foo>redirects all symbolic reference pointing to<foo>towards<alt_foo>. This option can be specified multiple times although CMake requires theSHELL:prefix for repeated parameters. Example:
target_link_options(tgt PRIVATE
SHELL:--redirect=__write=__write_buffered
SHELL:--redirect=_Printf=_PrintfFullNoMb
# other options... )-
--search <path>or-L <path>specifies a path in which the linker should search for objects and libraries. This option can be specified multiple times although CMake requires theSHELL:prefix for repeated parameters. Example:
target_link_options(tgt PRIVATE
SHELL:--search=/path/to/libs
SHELL:--search=/path/to/more-libs
# other options... )Below you will find details about ilinkarm's options available specifically for Arm targets.
-
--semihosting[=iarbreakpoint]links the target with Arm's semihosting debugging interface. Example:
target_link_options(tgt PRIVATE
--semihosting
# other options... )This is the cmake-tutorial wiki. Back to Wiki Home
- IAR Compiler options in a CMake project
- IAR ILINK options in a CMake project
- Language-specific target options
- Selecting build types
- Using Ninja Multi-Config
- Filing a build log
- Multi-file compilation
- Invoking IAR binary utilities
- Use the IAR ELF Tool to convert executable targets to their binary formats
- Using IAR Build Tools with CMake Presets