Fix build: search for Threads ourself instead of promoting imported target

This commit is contained in:
Jan Grulich 2022-11-01 13:27:23 +01:00
parent cf729e4c44
commit 6fa8a1ec82
2 changed files with 16 additions and 0 deletions

View File

@ -23,6 +23,8 @@ Source0: https://download.qt.io/development_releases/qt/%{majmin}/%{qt_version}/
Source0: https://download.qt.io/official_releases/qt/%{majmin}/%{version}/submodules/%{qt_module}-everywhere-src-%{version}.tar.xz Source0: https://download.qt.io/official_releases/qt/%{majmin}/%{version}/submodules/%{qt_module}-everywhere-src-%{version}.tar.xz
%endif %endif
Patch0: qtimageformats-fix-build.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: ninja-build BuildRequires: ninja-build

View File

@ -0,0 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 47694d0..3ba68b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,4 +16,9 @@ if(NOT TARGET Qt::Gui)
message(NOTICE "Skipping the build as the condition \"TARGET Qt::Gui\" is not met.")
return()
endif()
+if (NOT TARGET Threads::Threads)
+ find_package(Threads)
+endif()
+qt_internal_disable_find_package_global_promotion(Threads::Threads)
+
qt_build_repo()