From 83ecb65ec0a2d23435844e076d8ac1cc1f28cb90 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 2 Nov 2022 16:22:04 +0100 Subject: [PATCH] CMake: Propagate usage of WARNINGS_ARE_ERRORS when building repos When configuring a qtbase developer build, WARNINGS_ARE_ERRORS is set to ON and -Werror flags are added to the PlatformInternal targets. But the value of WARNINGS_ARE_ERRORS is not exported. This means that CMake code can't make decisions based on that variable when building other repos, and we now have such code with the new syncqt.cpp in qt_internal_target_sync_headers. Export the value of WARNINGS_ARE_ERRORS in QtBuildInternalsExtra.cmake.in. Fixes: QTBUG-108151 Change-Id: I5de2633fcb1f20fead7d436c201852424e726842 Reviewed-by: Alexey Edelev --- cmake/QtBuildInternalsExtra.cmake.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/QtBuildInternalsExtra.cmake.in b/cmake/QtBuildInternalsExtra.cmake.in index d259194ec28..49d929b6662 100644 --- a/cmake/QtBuildInternalsExtra.cmake.in +++ b/cmake/QtBuildInternalsExtra.cmake.in @@ -103,6 +103,9 @@ set(QT_BUILD_EXAMPLES_AS_EXTERNAL "@QT_BUILD_EXAMPLES_AS_EXTERNAL@" CACHE BOOL # Propagate usage of ccache. set(QT_USE_CCACHE @QT_USE_CCACHE@ CACHE BOOL "Enable the use of ccache") +# Propragate the value of WARNINGS_ARE_ERRORS. +set(WARNINGS_ARE_ERRORS "@WARNINGS_ARE_ERRORS@" CACHE BOOL "Build Qt with warnings as errors") + # Propagate usage of versioned hard link. set(QT_CREATE_VERSIONED_HARD_LINK "@QT_CREATE_VERSIONED_HARD_LINK@" CACHE BOOL "Enable the use of versioned hard link")