cmake: flash: support verbose output toggle
If CMAKE_VERBOSE_MAKEFILE is defined, make flashing and debugging more
verbose.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
diff --git a/cmake/flash/CMakeLists.txt b/cmake/flash/CMakeLists.txt
index 153a1ea..971d955 100644
--- a/cmake/flash/CMakeLists.txt
+++ b/cmake/flash/CMakeLists.txt
@@ -14,6 +14,13 @@
"--openocd-search=${OPENOCD_DEFAULT_PATH}"
)
+# Enable verbose output, if requested.
+if(CMAKE_VERBOSE_MAKEFILE)
+ set(RUNNER_VERBOSE "--verbose")
+else()
+ set(RUNNER_VERBOSE)
+endif()
+
foreach(target flash debug debugserver)
string(TOUPPER "${target}" target_upper)
@@ -42,6 +49,7 @@
${CMAKE_COMMAND} -E env
${PYTHON_EXECUTABLE}
$ENV{ZEPHYR_BASE}/scripts/support/zephyr_flash_debug.py
+ ${RUNNER_VERBOSE}
${runner}
${target}
${RUNNER_ARGS_COMMON}