From dafd50934d1fe1b8e08e455992fe00352907ac30 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 4 May 2020 19:11:00 +0200 Subject: [PATCH] esptool: don't generate flashing metadata in loadable elf build --- components/esptool_py/CMakeLists.txt | 14 ++++++++------ components/partition_table/CMakeLists.txt | 13 +++++++------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/components/esptool_py/CMakeLists.txt b/components/esptool_py/CMakeLists.txt index 6d3b01c80b..f4ce6e0a93 100644 --- a/components/esptool_py/CMakeLists.txt +++ b/components/esptool_py/CMakeLists.txt @@ -34,12 +34,14 @@ if(NOT BOOTLOADER_BUILD) set(ESPTOOLPY_AFTER "no_reset") endif() - file(READ "flasher_args.json.in" flasher_args_content) - string(CONFIGURE "${flasher_args_content}" flasher_args_content) + if(CONFIG_APP_BUILD_GENERATE_BINARIES) + file(READ "flasher_args.json.in" flasher_args_content) + string(CONFIGURE "${flasher_args_content}" flasher_args_content) - file_generate("${CMAKE_CURRENT_BINARY_DIR}/flasher_args.json.in" - CONTENT "${flasher_args_content}") - file_generate("${CMAKE_BINARY_DIR}/flasher_args.json" - INPUT "${CMAKE_CURRENT_BINARY_DIR}/flasher_args.json.in") + file_generate("${CMAKE_CURRENT_BINARY_DIR}/flasher_args.json.in" + CONTENT "${flasher_args_content}") + file_generate("${CMAKE_BINARY_DIR}/flasher_args.json" + INPUT "${CMAKE_CURRENT_BINARY_DIR}/flasher_args.json.in") + endif() endif() diff --git a/components/partition_table/CMakeLists.txt b/components/partition_table/CMakeLists.txt index 7d42c44489..2b78a1f226 100644 --- a/components/partition_table/CMakeLists.txt +++ b/components/partition_table/CMakeLists.txt @@ -97,9 +97,10 @@ endif() idf_component_get_property(main_args esptool_py FLASH_ARGS) idf_component_get_property(sub_args esptool_py FLASH_SUB_ARGS) -esptool_py_flash_target(partition_table-flash "${main_args}" "${sub_args}") -esptool_py_flash_target_image(partition_table-flash partition_table "${PARTITION_TABLE_OFFSET}" - "${build_dir}/partition_table/partition-table.bin") -esptool_py_flash_target_image(flash partition_table "${PARTITION_TABLE_OFFSET}" - "${build_dir}/partition_table/partition-table.bin") - +if(CONFIG_APP_BUILD_GENERATE_BINARIES) + esptool_py_flash_target(partition_table-flash "${main_args}" "${sub_args}") + esptool_py_flash_target_image(partition_table-flash partition_table "${PARTITION_TABLE_OFFSET}" + "${build_dir}/partition_table/partition-table.bin") + esptool_py_flash_target_image(flash partition_table "${PARTITION_TABLE_OFFSET}" + "${build_dir}/partition_table/partition-table.bin") +endif()