summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreapplication.cpp
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-07-19 23:45:18 -0700
committerJake Petroules <jake.petroules@qt.io>2017-07-21 04:58:07 +0000
commit8418a6335b3f8a029f48ee9b0a18500ddc760852 (patch)
treeb5e05638b3dff69c70bdbc48e24f4f7bf223127d /src/corelib/kernel/qcoreapplication.cpp
parent854fdaaf76873a4f5c6d5a5046b35bc8152fcc24 (diff)
Add a safety check to prevent apps from running on unsupported OSes
Although Qt declares its minimum supported OS version to the compiler and linker, the OS ignores this information when loading shared libraries, so instead of failing with a useful error message, the program will simply crash at runtime. This attempts to bring that failure as early in the lifecycle as possible, and provide a better error message as well. Change-Id: Ic58b44f8895eac718c94e62cad6e2506dbea8a7e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 6141a73966..1f736d7bf6 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -437,6 +437,9 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
, q_ptr(0)
#endif
{
+#if defined(Q_OS_DARWIN)
+ qt_apple_check_os_version();
+#endif
app_compile_version = flags & 0xffffff;
static const char *const empty = "";
if (argc == 0 || argv == 0) {