esp-idf/components/esptool_py
Arno Moonen c6913fa397 fix(build): fix build failure if CMAKE_EXECUTABLE_SUFFIX is set
From: Arno Moonen <arno.moonen@airios.eu>

Follows original message from Arno Moonen <arno.moonen@airios.eu>

While integrating the ESP-IDF into our existing CMake structure,
I've come across quite some hurdles. Most I've been able to fix
in our CMake files, however this one I could not.

Most of the targets created by the esptool_py component assume
that the EXECUTABLE IDF build property (which contains the name
of the CMake executable target) always equals the name of the
created binary.

This is however not always true. For instance, in our setup we use
CMAKE_EXECUTABLE_SUFFIX_C and CMAKE_EXECUTABLE_SUFFIX_CXX in our
toolchain file (both set to .elf). If we do add_executable(my_app),
the target binary file would actually be my_app.elf.

In order to fix this, I've updated it to use the TARGET_FILE generated
expression. That way we also no longer need the EXECUTABLE_DIR IDF build
property here.

I've fixed this on v5.0.1 (as that's the ESP-IDF version I'm currently
trying to integrate), but I assume it should be easy to apply the same
fix to newer versions and the master branch as well.

Note that this problem might exist in multiple places where EXECUTABLE
is being used. While going through the ESP-IDF code base, I even noticed
that a few places actually already seem to use the TARGET_FILE expression.
To be honest the property name might be somewhat confusing as well, as it
is actually the executable target.

Closes https://github.com/espressif/esp-idf/pull/12558
2023-11-20 10:49:02 +01:00
..
esptool
CMakeLists.txt
Kconfig.projbuild esp32h4: removed esp32h4 related codes 2023-04-26 18:53:12 +08:00
LICENSE
espefuse.cmake system-hardware/efuse: fixed efuse summary description containing ; breaking efuse-summary 2023-05-30 14:07:50 +08:00
flasher_args.json.in
get_port_args.cmake
project_include.cmake fix(build): fix build failure if CMAKE_EXECUTABLE_SUFFIX is set 2023-11-20 10:49:02 +01:00
run_serial_tool.cmake feat(esptool): allow to set force for write_flash 2023-04-21 09:36:18 +02:00
sdkconfig.rename