esp-idf/components/esptool_py
Arno Moonen 7d87f56e35 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-22 14:44:18 +00:00
..
esptool Tools: Fix esptool wrappers by avoiding importing the module 2022-11-21 15:20:14 +01:00
CMakeLists.txt crypto: initial S3 Beta 3 bringup and testing for SHA/AES/RSA/flash enc 2021-05-18 11:25:41 +08:00
flasher_args.json.in esptool: Add support for ESP32-S2 Secure Download Mode 2020-05-28 17:52:15 +10:00
get_port_args.cmake esptool_py: simplify serial tool script 2020-12-17 11:25:32 +08:00
Kconfig.projbuild esp32h2: disable no_stub option 2022-08-08 20:44:15 +08:00
LICENSE Initial public version 2016-08-17 23:08:22 +08:00
project_include.cmake fix(build): fix build failure if CMAKE_EXECUTABLE_SUFFIX is set 2023-11-22 14:44:18 +00:00
run_serial_tool.cmake feat(esptool): allow to set force for write_flash 2023-04-18 13:47:09 +02:00
sdkconfig.rename Tools: Custom baud-rate setup is not possible for IDF Monitor from menuconfig anymore 2022-01-24 18:13:38 +01:00