ARMmbed / mbed-tools

⚠️ Beta Status: New command line tooling for Mbed OS
Apache License 2.0
45 stars 29 forks source link

how to set CMAKE_CXX_COMPILER ? #334

Open Layty opened 9 months ago

Layty commented 9 months ago

I have two gcc in path , how can I use the second?

Now I have to fix mbed-os\tools\cmake\toolchains\GCC_ARM.cmake

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

to

set(CMAKE_ASM_COMPILER "arm-none-eabi-gcc")

set(CMAKE_C_COMPILER "arm-none-eabi-gcc")

set(CMAKE_CXX_COMPILER "arm-none-eabi-g++")

then use

cmake -D CMAKE_CXX_COMPILER=xxx -D CMAKE_C_COMPILER=xxx ?