a9183756-gh / Arduino-CMake-Toolchain

CMake toolchain for all Arduino compatible boards
MIT License
135 stars 40 forks source link

Toolchain build fails on Mac OS with ESP32 Platform v2.x.x #63

Closed KSDaemon closed 1 year ago

KSDaemon commented 1 year ago

Hi there!

I faced the problem of setting up toolchain for building for ESP32 v2.x.x platform on Mac OS.

The typical setup like using basic hello_world example fails with the next error:

CMake Error at CMakeLists.txt:5 (project):
  The CMAKE_CXX_COMPILER:

    {tools.xtensa-esp32-elf-gcc.path}/bin/xtensa-esp32-elf-g++

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

As I researched the problem is that complex variables of platform.txt for 2.0.x are not expanded properly.

For example this one:

compiler.path={tools.{build.tarch}-{build.target}-elf-gcc.path}/bin/

All properties that are constructed of variables inside variables like in the example above are expanded to only one level.

I compared platform.txt of v1 and v2 — and indeed, v2 heavily uses kind of recursive expansion.

I'm trying to figure out the place inside the toolchain where this expansion is made to fix it. If someone knows — please point me to.

UPDATE: I'm testing on release-1.1-dev branch.

/cc @a9183756-gh @technyon

KSDaemon commented 1 year ago

I know there is a https://github.com/a9183756-gh/Arduino-CMake-Toolchain/pull/53 but somehow it doesn't work...

KSDaemon commented 1 year ago

After some tries managed to apply patch https://github.com/a9183756-gh/Arduino-CMake-Toolchain/pull/53 which helps :)