summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-07-01 13:40:11 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-08-03 12:49:09 +0000
commit7c8a1aa2ce0cff5e5adb6d4cf6be814850a1ce71 (patch)
treed898219ad04ace1d4225c8e984108051d25c25aa /mkspecs
parent73d6c2058fcb23ec9d126b7f862cf588d31222af (diff)
Limit OpenGL deprecation silencing on Apple platform to Qt itself
Apple deprecated the entire OpenGL API in favor of Metal, which we are aware of, so we don't need to see the warnings when building Qt. Instead of applying the silencing globally for all Qt consumers, both internal and external, we now limit the silencing to Qt itself. That means user code that explicitly uses any of the deprecated APIs will see the warnings. Note that this does not apply to merely using any of the Qt OpenGL APIs. The user has to explicitly use the platform APIs that have been deprecated. The warnings need to be disabled on a build system level, so that that they are passed as -D flags on the command line. If the defines were done in Qt headers (qguiglobal.h e.g.), they would require the user to always include this header before any of the Apple headers. Change-Id: I3f2a2a5211332a059ad4416394251772c677fdcb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 1048d83fc29d77e7a8def35ba41454fe35f4747b) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/common/uikit.conf2
-rw-r--r--mkspecs/features/qt_common.prf7
2 files changed, 7 insertions, 2 deletions
diff --git a/mkspecs/common/uikit.conf b/mkspecs/common/uikit.conf
index 424381e285..0388b8e616 100644
--- a/mkspecs/common/uikit.conf
+++ b/mkspecs/common/uikit.conf
@@ -7,6 +7,4 @@ CONFIG += bitcode reduce_exports shallow_bundle no_qt_rpath
INCLUDEPATH += $$PWD/uikit
-DEFINES += GLES_SILENCE_DEPRECATION
-
include(mac.conf)
diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
index 8df94aa4ee..421adcdaa0 100644
--- a/mkspecs/features/qt_common.prf
+++ b/mkspecs/features/qt_common.prf
@@ -62,6 +62,13 @@ contains(TEMPLATE, .*lib)|darwin {
if(!host_build|!cross_compile):qtConfig(reduce_exports): CONFIG += hide_symbols
}
+# Apple deprecated the entire OpenGL API in favor of Metal, which
+# we are aware of, so silence the deprecation warnings in code.
+# This does not apply to user-code, which will need to silence
+# their own warnings if they use the deprecated APIs explicitly.
+macos: DEFINES += GL_SILENCE_DEPRECATION
+uikit: DEFINES += GLES_SILENCE_DEPRECATION
+
# The remainder of this file must not apply to host tools/libraries,
# as the host compiler's version and capabilities are not checked.
host_build:cross_compile: return()