Skip to contentSkip to conversation

cmake: Add a knob for cmake VERBOSE settings

PATCH Superseded Khem Raj 1 participant 1 message Dec 19, 2019

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/1 cmake: Add a knob for cmake VERBOSE settings

Setting VERBOSE always, while is fine on one hand for debugging, its coming at an expense of creating lots and lots of logs, e.g. qtwebkit compile logs alone with VERBOSE is 163MB, there are many other large packages which use cmake e.g. WPE, webkitgtk etc which are in same range with out this option on, the logs reduce to 861K and also speeds up build a notch

If user needs to disable these logs for a recipe or globally

CMAKE_VERBOSE = ""

in recipe or in global metadata e.g. local.conf

Cc Ross Burton <[email protected]>
Cc Andre McCurdy <[email protected]>

---
v2: Make a knob for verbose option and keep the defaults as such

 meta/classes/cmake.bbclass | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
meta/classes/cmake.bbclass +13 -2
index 8ccb1eefc7..14796ac053 100644
@@ -181,9 +181,20 @@ cmake_do_configure() {
 	  -Wno-dev
 }
 
+# To disable verbose cmake logs for a given recipe or globally config metadata e.g. local.conf
+# add following
+#
+# CMAKE_VERBOSE = ""
+#
+
+CMAKE_VERBOSE ??= "-v"
+
+EXTRA_OECMAKE_BUILD_append = " ${CMAKE_VERBOSE}"
+
+# Then run do_compile again
 cmake_runcmake_build() {
-	bbnote ${DESTDIR:+DESTDIR=${DESTDIR} }VERBOSE=1 cmake --build '${B}' "$@" -- ${EXTRA_OECMAKE_BUILD}
-	eval ${DESTDIR:+DESTDIR=${DESTDIR} }VERBOSE=1 cmake --build '${B}' "$@" -- ${EXTRA_OECMAKE_BUILD}
+	bbnote ${DESTDIR:+DESTDIR=${DESTDIR} } cmake --build '${B}' "$@" -- ${EXTRA_OECMAKE_BUILD}
+	eval ${DESTDIR:+DESTDIR=${DESTDIR} } cmake --build '${B}' "$@" -- ${EXTRA_OECMAKE_BUILD}
 }
 
 cmake_do_compile()  {
Signature · 1 line
2.24.1