mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 16:25:26 +03:00
[BUILD] Add support for openocd helpers with cmake
- Add openocd_<target>: runs openocd for the target - Add openocd_flash_<target>: flashes the target using openocd. It works with both an already running openocd instance as well as launching its own one. Uses a helper tool that requires python. - Add openocd_cfg_<target>: generates openocd config for target. Used for generating an openocd config automatically when launching a debug session from an IDE.
This commit is contained in:
parent
fb9f61a583
commit
d6177e6933
10 changed files with 211 additions and 11 deletions
|
@ -53,6 +53,14 @@ function(setup_firmware_target name)
|
|||
)
|
||||
get_property(targets GLOBAL PROPERTY VALID_TARGETS)
|
||||
set_property(GLOBAL PROPERTY VALID_TARGETS "${targets} ${name}")
|
||||
setup_openocd(${name})
|
||||
endfunction()
|
||||
|
||||
function(exclude_from_all target)
|
||||
set_property(TARGET ${target} PROPERTY
|
||||
TARGET_MESSAGES OFF
|
||||
EXCLUDE_FROM_ALL 1
|
||||
EXCLUDE_FROM_DEFAULT_BUILD 1)
|
||||
endfunction()
|
||||
|
||||
function(collect_targets)
|
||||
|
@ -61,8 +69,5 @@ function(collect_targets)
|
|||
set(list_target_name "targets")
|
||||
add_custom_target(${list_target_name}
|
||||
COMMAND cmake -E echo "Valid targets: ${targets}")
|
||||
set_property(TARGET ${list_target_name} PROPERTY
|
||||
TARGET_MESSAGES OFF
|
||||
EXCLUDE_FROM_ALL 1
|
||||
EXCLUDE_FROM_DEFAULT_BUILD 1)
|
||||
exclude_from_all(${list_target_name})
|
||||
endfunction()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue