summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2023-08-02 17:53:37 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2024-03-20 09:57:05 +0100
commitec9b70c5616aa7522fa6ed0bfb74d1f6549564c2 (patch)
treeb2e243903adf12a1fb3c25707338a14e7c5e119b /cmake
parent0c38013c71f28015e00b29852a2f20f40aab65c8 (diff)
CMake: Disable ExternalProject examples for -debug-and-release builds
Unfortunately when using CMake <= 3.27 together with -debug-and-release, it's not possible to reliably build examples as external projects due to clobbered files in the same build dir. Disable building examples as EPs in such a case. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: Icea9fdab47986c2608e1952a0bbae72365ac7a62 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit c668dd4044283b6eac86f7ab8177595e207567d7) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuildOptionsHelpers.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmake/QtBuildOptionsHelpers.cmake b/cmake/QtBuildOptionsHelpers.cmake
index fbf2aa2b79..5fe3494bb9 100644
--- a/cmake/QtBuildOptionsHelpers.cmake
+++ b/cmake/QtBuildOptionsHelpers.cmake
@@ -306,7 +306,11 @@ macro(qt_internal_setup_build_examples)
"Install example sources as part of the default 'install' target" ON)
# FIXME: Support prefix builds as well QTBUG-96232
- if(QT_WILL_INSTALL)
+ # We don't want to enable EP examples with -debug-and-release because starting with CMake 3.24
+ # ExternalProject_Add ends up creating build rules twice, once for each configuration, in the
+ # same build dir, which ends up causing various issues due to concurrent builds as well as
+ # clobbered CMakeCache.txt and ninja files.
+ if(QT_WILL_INSTALL OR QT_FEATURE_debug_and_release)
set(_qt_build_examples_as_external OFF)
else()
set(_qt_build_examples_as_external ON)