From 57a69d9d0bc6b930faf4955944ab4aaf11d459fd Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 10 May 2022 13:48:38 +0200 Subject: [PATCH] CMake build: Avoid endless loop if plugin does not exist get_property fails if the target does not exist, and _dep stays at some old value. This leads to a) a lot of cmake backtraces with an error message that doesn't add anything useful, and b) an endless loop in find_dependent_plugins. Which in the end leads to 500.000 lines of useless CMake output, repeating "qtcreator/cmake/QtCreatorAPIInternal.cmake:340 (find_dependent_plugins)" Skip get_property if the target doesn't exist. Change-Id: Ic694bc05b3dce5b83220a2f5dab8f063ef692c12 Reviewed-by: Eike Ziller --- cmake/QtCreatorAPIInternal.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/QtCreatorAPIInternal.cmake b/cmake/QtCreatorAPIInternal.cmake index d7bef93491f..53522ee5f70 100644 --- a/cmake/QtCreatorAPIInternal.cmake +++ b/cmake/QtCreatorAPIInternal.cmake @@ -295,6 +295,10 @@ function(find_dependent_plugins varName) set(_RESULT ${ARGN}) foreach(i ${ARGN}) + if(NOT TARGET ${i}) + continue() + endif() + set(_dep) get_property(_dep TARGET "${i}" PROPERTY _arg_DEPENDS) if (_dep) find_dependent_plugins(_REC ${_dep})