bsp_linker_flags

Specifies a list of linker flags that will be added to all executables using the specified BSP instance.

Syntax

bsp_linker_flags(
    BSP_ALIAS <alias>

    <Flag 1>
    <Flag 2>
    ...
    <Flag N>
)

Overview

The bsp_linker_flags command adds the specified linker flags to all applications referencing a specific BSP (see the add_bsp_based_executable command).

Parameters

BSP_ALIAS
Optional. If the project loads multiple BSPs, this parameter allows selecting a specific BSP instance.
Flags
Specifies one or more linker flags (LDFLAGS) that will be added when linking all related executables.

Remarks

You can configure the list of extra linker flags added to a specific BSP instance by locating the BSP node in Solution Explorer and using the Properties -> Compiler Settings -> Additional LDFLAGS setting.

Examples

The following example will enable the memory usage output for all executables using the default BSP:

find_bsp(ID com.sysprogs.arm.stm32
         VERSION 2020.10
         MCU STM32F407VG)
bsp_linker_flags( -Wl,--print-memory-usage)
add_bsp_based_executable(NAME Application1
                         SOURCES Application1.cpp)

If the project contains multiple BSPs, use the BSP_ALIAS parameter to select a specific instance. See bsp_include_directories for a specific example.

See also

BSP-Related Statements, bsp_compile_definitions, bsp_compile_flags, bsp_include_directories, find_bsp