diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-07-28 16:45:07 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-07-29 13:25:28 +0200 |
commit | 19d32f0a5fc8b12e03a84ab6e18845337fd3b70f (patch) | |
tree | c0f3e33e8d5fc1d1f9d32b2b5f580b120ede1ba1 /src/corelib/kernel/qcore_mac_p.h | |
parent | 3e71e2e85124b750c0e385212d44ea57acf270f3 (diff) |
Add QOperatingSystemVersion support for macOS Big Sur
Pick-to: 5.15
Pick-to: 5.12
Change-Id: Ide57f675b20b08210f301da5177df45d008423c4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/corelib/kernel/qcore_mac_p.h')
-rw-r--r-- | src/corelib/kernel/qcore_mac_p.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h index 306d6ac8bb..3617eb33d4 100644 --- a/src/corelib/kernel/qcore_mac_p.h +++ b/src/corelib/kernel/qcore_mac_p.h @@ -53,6 +53,9 @@ #include "private/qglobal_p.h" +#include <QtCore/qoperatingsystemversion.h> +struct mach_header; + #ifndef __IMAGECAPTURE__ # define __IMAGECAPTURE__ #endif @@ -415,6 +418,32 @@ private: // ------------------------------------------------------------------------- +#if QT_POINTER_SIZE == 4 +#error "32-bit builds are not supported" +#endif + +class Q_CORE_EXPORT QMacVersion +{ +public: + enum VersionTarget { + ApplicationBinary, + QtLibraries + }; + + static QOperatingSystemVersion buildSDK(VersionTarget target = ApplicationBinary); + static QOperatingSystemVersion deploymentTarget(VersionTarget target = ApplicationBinary); + static QOperatingSystemVersion currentRuntime(); + +private: + QMacVersion() = default; + using VersionTuple = QPair<QOperatingSystemVersion, QOperatingSystemVersion>; + static VersionTuple versionsForImage(const mach_header *machHeader); + static VersionTuple applicationVersion(); + static VersionTuple libraryVersion(); +}; + +// ------------------------------------------------------------------------- + QT_END_NAMESPACE #endif // QCORE_MAC_P_H |