Skip to content

CMake: Allow providing a custom toolchain file #14446

Open
@boraozgen

Description

@boraozgen

Previously mentioned here: ARMmbed/mbed-tools#153

The following lines force CMake to use the toolchain from PATH.

set(CMAKE_ASM_COMPILER "arm-none-eabi-gcc")
set(CMAKE_C_COMPILER "arm-none-eabi-gcc")
set(CMAKE_CXX_COMPILER "arm-none-eabi-g++")
set(GCC_ELF2BIN "arm-none-eabi-objcopy")

This should instead be provided by the user (IDEs like VSCode and CLion do this). Otherwise it leads to configuration issues when using multiple toolchains in the same project. I have such a use case, where I build another target to run my GUI library on the host.

Is there a case against removing these lines? GCC_ELF2BIN could then be derived from the provided compiler location.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions