mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
feat(partition_table): Allow configuration of absolute path for custom partitions.csv file
This commit allows the configuration of an absolute path for the custom partitions.csv file via the Kconfig option CONFIG_PARTITION_TABLE_CUSTOM_FILENAME. Closes https://github.com/espressif/esp-idf/issues/12264
This commit is contained in:
parent
2eacbbe957
commit
236498b040
@ -89,8 +89,8 @@ menu "Partition Table"
|
||||
string "Custom partition CSV file" if PARTITION_TABLE_CUSTOM
|
||||
default "partitions.csv"
|
||||
help
|
||||
Name of the custom partition CSV filename. This path is evaluated
|
||||
relative to the project root directory.
|
||||
Name of the custom partition CSV filename. This path is evaluated 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
|
||||
string
|
||||
|
@ -9,10 +9,15 @@ if(NOT BOOTLOADER_BUILD)
|
||||
# Set PARTITION_CSV_PATH to the configured partition CSV file
|
||||
# absolute path
|
||||
if(CONFIG_PARTITION_TABLE_CUSTOM)
|
||||
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}")
|
||||
# If the partition CSV file config already has the absolute path then set PARTITION_CSV_PATH directly
|
||||
if(IS_ABSOLUTE ${CONFIG_PARTITION_TABLE_FILENAME})
|
||||
set(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}")
|
||||
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}")
|
||||
message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. "
|
||||
|
Loading…
Reference in New Issue
Block a user