Cypress: Improve `mbed_post_build_psoc6_merge_hex()`
The CMake macro `mbed_post_build_psoc6_merge_hex()` takes the name of
a Cypress target and an optional Cortex-M0 hex image as arguments. The
proper way to define and parse optional arguments of a function or
macro is `cmake_parse_arguments()`, which allows the caller to
indicate what they are passing rather than rely on an argument's
relative position within `${ARGN}` which is not rigorous.

Also, avoid duplicating the common part of the post build command
when the optional argument is passed/not passed.
ls
1 parent 351680f commit 91b81866157066a6c5ef975f76f92a98107c7c7a
@Lingkai Dong Lingkai Dong authored on 22 Jul 2021
Showing 2 changed files
View
targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYSBSYSKIT_01/CMakeLists.txt
View
targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake