Merge branch 'feature/allow_abs_path_for_partitions_csv' into 'master'

feat(partition_table): Allow configuration of absolute path for custom partitions.csv file

Closes IDFGH-11092

See merge request espressif/esp-idf!27652
This commit is contained in:
Sudeep Mohanty
2024-01-16 23:46:27 +08:00
2 changed files with 11 additions and 6 deletions

View File

@@ -89,8 +89,8 @@ menu "Partition Table"
string "Custom partition CSV file" if PARTITION_TABLE_CUSTOM string "Custom partition CSV file" if PARTITION_TABLE_CUSTOM
default "partitions.csv" default "partitions.csv"
help help
Name of the custom partition CSV filename. This path is evaluated Name of the custom partition CSV filename. This path is evaluated relative to the project root directory
relative to the project root directory. by default. However, if the abolute path for the CSV file is provided, then the absolute path is configured.
config PARTITION_TABLE_FILENAME config PARTITION_TABLE_FILENAME
string string

View File

@@ -9,10 +9,15 @@ if(NOT BOOTLOADER_BUILD)
# Set PARTITION_CSV_PATH to the configured partition CSV file # Set PARTITION_CSV_PATH to the configured partition CSV file
# absolute path # absolute path
if(CONFIG_PARTITION_TABLE_CUSTOM) if(CONFIG_PARTITION_TABLE_CUSTOM)
idf_build_get_property(project_dir PROJECT_DIR) # If the partition CSV file config already has the absolute path then set PARTITION_CSV_PATH directly
# Custom filename expands any path relative to the project if(IS_ABSOLUTE ${CONFIG_PARTITION_TABLE_FILENAME})
get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" set(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}")
ABSOLUTE BASE_DIR "${project_dir}") else()
idf_build_get_property(project_dir PROJECT_DIR)
# Custom filename expands any path relative to the project
get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}"
ABSOLUTE BASE_DIR "${project_dir}")
endif()
if(NOT EXISTS "${PARTITION_CSV_PATH}") if(NOT EXISTS "${PARTITION_CSV_PATH}")
message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. "