From b6f3695a80f5abfbcfb0ebb5b03358b8e7bbbaf9 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Wed, 27 Nov 2024 09:19:56 +0800 Subject: [PATCH] Cocoa: emit config error when using 15.0 as deployment target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QCocoaScreen uses removed APIs, which cause the code no fail compilation with CMAKE_OSX_DEPLOYMENT_TARGET=15.0. Adding a compile-time check to detect this early. Task-number: QTBUG-128900 Pick-to: 6.9 6.8 6.5 Change-Id: I7eeb60f5769af6b1622efd1e0637e85a038b7930 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/platforms/cocoa/CMakeLists.txt b/src/plugins/platforms/cocoa/CMakeLists.txt index 491c61703fb..87f2b8c3d2e 100644 --- a/src/plugins/platforms/cocoa/CMakeLists.txt +++ b/src/plugins/platforms/cocoa/CMakeLists.txt @@ -79,6 +79,11 @@ qt_internal_add_resource(QCocoaIntegrationPlugin "qcocoaresources" ${qcocoaresources_resource_files} ) +if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 15.0) + message(FATAL_ERROR "QCocoaScreen uses APIs removed in 15.0. Please specify a + CMAKE_OSX_DEPLOYMENT_TARGET of 14.0 or lower") +endif() + ## Scopes: #####################################################################