From 1b80f00f56fb66ae7b03d3a95389b85380b2a2a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Thu, 13 Sep 2018 13:57:24 +0200 Subject: [PATCH] cmake: Suppress the stderr from 'git describe' on successfull runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A confusing warning has popped up since 3.13. It can be observed as so: Zephyr version: 1.13.99 Parsing Kconfig tree in /home/sebo/zephyr/Kconfig Merging /home/sebo/zephyr/samples/hello_world/prj.conf warning: tag 'zephyr-v1.13.0' is really 'v1.13.0' here -- Generating zephyr/include/generated/generated_dts_board.h This warning is more confusing than useful so we suppress stderr from 'git describe' when the command runs successfully. Signed-off-by: Sebastian Bøe --- cmake/app/boilerplate.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmake/app/boilerplate.cmake b/cmake/app/boilerplate.cmake index aa8420458bb..b889823c3e3 100644 --- a/cmake/app/boilerplate.cmake +++ b/cmake/app/boilerplate.cmake @@ -262,7 +262,15 @@ if(GIT_FOUND) execute_process(COMMAND ${GIT_EXECUTABLE} describe WORKING_DIRECTORY ${ZEPHYR_BASE} OUTPUT_VARIABLE BUILD_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE stderr + RESULT_VARIABLE return_code + ) + if(return_code) + message(FATAL_ERROR "${stderr}") + elseif(CMAKE_VERBOSE_MAKEFILE) + message(STATUS "git describe stderr: ${stderr}") + endif() endif() set(SOC_NAME ${CONFIG_SOC})