cmake: flash: remove unused cache variables

Resolve a TODO item that followed the introduction of runners.yaml
files by removing the now-unused CMake cache variables that they
obsolete.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2020-08-07 15:48:08 -07:00 committed by Anas Nashif
commit c1f80db44a

View file

@ -93,48 +93,9 @@ get_property(RUNNERS GLOBAL PROPERTY ZEPHYR_RUNNERS)
#
# Everything is marked with FORCE so that re-running CMake updates the
# configuration if the board files change.
#
# TODO: drop the hack in sign.py that uses cached_runner_config to
# guess the .bin and .hex files, then delete the cache variables.
if(RUNNERS)
create_runners_yaml(${RUNNERS})
set(ZEPHYR_RUNNERS ${RUNNERS} CACHE INTERNAL "Available runners")
# Runner configuration. This is provided to all runners, and is
# distinct from the free-form arguments provided by e.g.
# board_runner_args().
#
# Always applicable:
set(ZEPHYR_RUNNER_CONFIG_BOARD_DIR "${BOARD_DIR}"
CACHE STRING "Board definition directory" FORCE)
set(ZEPHYR_RUNNER_CONFIG_KERNEL_ELF "${PROJECT_BINARY_DIR}/${KERNEL_ELF_NAME}"
CACHE STRING "Path to kernel image in ELF format" FORCE)
get_property(HEX_FILES_TO_MERGE GLOBAL PROPERTY HEX_FILES_TO_MERGE)
if(HEX_FILES_TO_MERGE)
set(ZEPHYR_RUNNER_CONFIG_KERNEL_HEX "${PROJECT_BINARY_DIR}/${MERGED_HEX_NAME}"
CACHE STRING "Path to merged image in Intel Hex format" FORCE)
else()
set(ZEPHYR_RUNNER_CONFIG_KERNEL_HEX "${PROJECT_BINARY_DIR}/${KERNEL_HEX_NAME}"
CACHE STRING "Path to kernel image in Intel Hex format" FORCE)
endif()
set(ZEPHYR_RUNNER_CONFIG_KERNEL_BIN "${PROJECT_BINARY_DIR}/${KERNEL_BIN_NAME}"
CACHE STRING "Path to kernel image as raw binary" FORCE)
# Not always applicable, but so often needed that they're provided
# by default: (TODO: clean this up)
if(DEFINED CMAKE_GDB)
set(ZEPHYR_RUNNER_CONFIG_GDB "${CMAKE_GDB}"
CACHE STRING "Path to GDB binary, if applicable" FORCE)
endif()
if(DEFINED OPENOCD)
set(ZEPHYR_RUNNER_CONFIG_OPENOCD "${OPENOCD}"
CACHE STRING "Path to openocd binary, if applicable" FORCE)
endif()
if(DEFINED OPENOCD_DEFAULT_PATH)
set(ZEPHYR_RUNNER_CONFIG_OPENOCD_SEARCH "${OPENOCD_DEFAULT_PATH}"
CACHE STRING "Path to add to openocd search path, if applicable" FORCE)
endif()
# Runner-specific command line arguments obtained from the board's
# build scripts, the application's scripts, etc.
foreach(runner ${RUNNERS})
@ -145,14 +106,6 @@ if(RUNNERS)
"Runner-specific arguments for ${runner}" FORCE)
endforeach()
endif()
if(BOARD_FLASH_RUNNER)
set(ZEPHYR_BOARD_FLASH_RUNNER ${BOARD_FLASH_RUNNER} CACHE STRING
"Default runner for flashing binaries" FORCE)
endif()
if(BOARD_DEBUG_RUNNER)
set(ZEPHYR_BOARD_DEBUG_RUNNER ${BOARD_DEBUG_RUNNER} CACHE STRING
"Default runner for debugging" FORCE)
endif()
if(DEFINED ENV{WEST_DIR} AND NOT WEST_DIR)
set(WEST_DIR $ENV{WEST_DIR})