esp-idf/components/esptool_py
Arno Moonen fec80b5d36 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-16 08:14:19 +01:00
..
esptool Tools: Fix esptool wrappers by avoiding importing the module 2022-11-11 12:59:46 +01:00
CMakeLists.txt refactor(linux): excluded all non-Linux components from build 2023-10-16 17:06:54 +08:00
espefuse.cmake system-hardware/efuse: fixed efuse summary description containing ; breaking efuse-summary 2023-05-30 10:55:27 +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 spi_flash: fixed issue that enabling HPM-DC by default may cause app unable to restart 2023-10-24 10:38:08 +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-16 08:14:19 +01:00
run_serial_tool.cmake feat(esptool): allow to set force for write_flash 2023-04-17 12:53:01 +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