Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-67534

qt_apple_check_os_version fails with WatchOS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.10.1
    • Fix Version/s: 5.11.1
    • Component/s: Core: Plugins
    • Labels:
      None
    • Environment:

      Description

      When for some reason we end up in qt_apple_check_os_version on WatchOS, we end up with an assert saying that iOS version 4.3 is not compatible with Qt that requires an higher version of iOS.

       

      Just try to instantiate a QGuiApplication into a WatchOS app for instance.

       

      This is due to something rather interesting when building Qt for WatchOS.

       

      When adding these line after all includes within qtbase/src/corelib/kernel/qcore_mac_objc.mm:

      50 #define STR(X) #X
      51 #define DEFER(M,...) M(_VA_ARGS_)
      52 #pragma message "env ios min version required is " DEFER(STR,_ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED_)
      53 #pragma message "env mac min version required is " DEFER(STR,_ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED_)
      54 #pragma message "env watch min version required is " DEFER(STR,_ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED_)
      55
      56 #pragma message "ios min version required is " DEFER(STR,__IPHONE_OS_VERSION_MIN_REQUIRED)
      57 #pragma message "mac min version required is " DEFER(STR,__MAC_OS_X_VERSION_MIN_REQUIRED)
      58 #pragma message "watch min version required is " DEFER(STR,__WATCH_OS_VERSION_MIN_REQUIRED)

       

       

      You have the following output when it is compiled for watchOS:

       

      kernel/qcore_mac_objc.mm:52:9: warning: env ios min version required is _ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED_ -W#pragma-messages
      #pragma message "env ios min version required is " DEFER(STR,_ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED_)
      ^
      kernel/qcore_mac_objc.mm:53:9: warning: env mac min version required is _ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED_ -W#pragma-messages
      #pragma message "env mac min version required is " DEFER(STR,_ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED_)
      ^
      kernel/qcore_mac_objc.mm:54:9: warning: env watch min version required is 30000 -W#pragma-messages
      #pragma message "env watch min version required is " DEFER(STR,_ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED_)
      ^
      kernel/qcore_mac_objc.mm:56:9: warning: ios min version required is 90000 -W#pragma-messages
      #pragma message "ios min version required is " DEFER(STR,__IPHONE_OS_VERSION_MIN_REQUIRED)
      ^
      kernel/qcore_mac_objc.mm:57:9: warning: mac min version required is __MAC_OS_X_VERSION_MIN_REQUIRED -W#pragma-messages
      #pragma message "mac min version required is " DEFER(STR,__MAC_OS_X_VERSION_MIN_REQUIRED)
      ^
      kernel/qcore_mac_objc.mm:58:9: warning: watch min version required is 30000 -W#pragma-messages
      #pragma message "watch min version required is " DEFER(STR,__WATCH_OS_VERSION_MIN_REQUIRED)

       

      You can easily see that _IPHONE_OS_VERSION_MIN_REQUIRED is defined while it should not since __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED_ is not set . Otherwise everything for WATCH_OS is properly set but this messes up the  qt_apple_check_os_version.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            vestbo Tor Arne Vestbø
            Reporter:
            MaxLeb67 Maxime Leblanc
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes