summaryrefslogtreecommitdiffstats
path: root/mkspecs
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2024-03-18 19:35:52 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2024-04-18 05:00:57 +0200
commitd5bf42f75b0ae35b7f02bb9211787ae1d44a98ba (patch)
tree3aa389137752dbe2bbaa7446e4ef0e2e1b8c55a5 /mkspecs
parentbf2ed624091d0239bce91a84df59b7afc843298a (diff)
Add preliminary support for Qt for visionOS
Qt already runs on Vision Pro as "Designed for iPad", using Qt for iOS. This change enables building Qt for visionOS directly, which opens the door to visionOS specific APIs and use-cases such as volumes and immersive spaces. The platform removes some APIs we depend on, notably UIScreen, so some code paths have been disabled or mocked to get something up and running. As our current window management approach on UIKit platforms depends on UIWindow and UIScreen there is currently no way to bring up QWindows. This will improve once we refactor our window management to use window scenes. To configure for visionOS, pass -platform macx-visionos-clang, and optionally add -sdk xrsimulator to build for the simulator. Change-Id: I4eda55fc3fd06e12d30a188928487cf68940ee07 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/mac/default_post.prf24
-rw-r--r--mkspecs/features/toolchain.prf2
-rw-r--r--mkspecs/macx-visionos-clang/Info.plist.app39
-rw-r--r--mkspecs/macx-visionos-clang/Info.plist.dSYM.in18
-rw-r--r--mkspecs/macx-visionos-clang/Info.plist.lib20
-rw-r--r--mkspecs/macx-visionos-clang/qmake.conf29
-rw-r--r--mkspecs/macx-visionos-clang/qplatformdefs.h4
7 files changed, 127 insertions, 9 deletions
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index 0b64a586b9..22c84d6473 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -120,10 +120,12 @@ macx-xcode {
QMAKE_XCODE_ARCHS =
- arch_device.name = "ARCHS[sdk=$${device.sdk}*]"
- arch_device.value = $$QMAKE_APPLE_DEVICE_ARCHS
- QMAKE_XCODE_ARCHS += $$QMAKE_APPLE_DEVICE_ARCHS
- QMAKE_MAC_XCODE_SETTINGS += arch_device
+ !isEmpty(QMAKE_APPLE_DEVICE_ARCHS) {
+ arch_device.name = "ARCHS[sdk=$${device.sdk}*]"
+ arch_device.value = $$QMAKE_APPLE_DEVICE_ARCHS
+ QMAKE_XCODE_ARCHS += $$QMAKE_APPLE_DEVICE_ARCHS
+ QMAKE_MAC_XCODE_SETTINGS += arch_device
+ }
ios:simulator {
arch_simulator.name = "ARCHS[sdk=$${simulator.sdk}*]"
@@ -224,10 +226,16 @@ macx-xcode {
platform_identifier = $$device.sdk
sysroot_path = $$xcodeSDKInfo(Path, $$device.sdk)
}
- version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
- QMAKE_CFLAGS += -isysroot $$sysroot_path $$version_min_flag
- QMAKE_CXXFLAGS += -isysroot $$sysroot_path $$version_min_flag
- QMAKE_LFLAGS += -isysroot $$sysroot_path $$version_min_flag
+ QMAKE_CFLAGS += -isysroot $$sysroot_path
+ QMAKE_CXXFLAGS += -isysroot $$sysroot_path
+ QMAKE_LFLAGS += -isysroot $$sysroot_path
+
+ !isEmpty(version_identifier):!isEmpty(deployment_target) {
+ version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
+ QMAKE_CFLAGS += $$version_min_flag
+ QMAKE_CXXFLAGS += $$version_min_flag
+ QMAKE_LFLAGS += $$version_min_flag
+ }
}
# Enable precompiled headers for multiple architectures
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
index bfad10d35b..13bf7f12ac 100644
--- a/mkspecs/features/toolchain.prf
+++ b/mkspecs/features/toolchain.prf
@@ -182,7 +182,7 @@ isEmpty($${target_prefix}.INCDIRS) {
# UIKit simulator platforms will see the device SDK's sysroot in
# QMAKE_DEFAULT_*DIRS, because they're handled in a single build pass.
darwin {
- uikit {
+ uikit:!isEmpty(QMAKE_APPLE_DEVICE_ARCHS) {
# Clang doesn't automatically pick up the architecture, just because
# we're passing the iOS sysroot below, and we will end up building the
# test for the host architecture, resulting in linker errors when
diff --git a/mkspecs/macx-visionos-clang/Info.plist.app b/mkspecs/macx-visionos-clang/Info.plist.app
new file mode 100644
index 0000000000..df76305bde
--- /dev/null
+++ b/mkspecs/macx-visionos-clang/Info.plist.app
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+
+ <key>CFBundleIconFile</key>
+ <string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
+
+ <key>CFBundleIdentifier</key>
+ <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
+
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+
+ <key>CFBundleShortVersionString</key>
+ <string>${QMAKE_SHORT_VERSION}</string>
+
+ <key>CFBundleVersion</key>
+ <string>${QMAKE_FULL_VERSION}</string>
+
+ <key>CFBundleDevelopmentRegion</key>
+ <string>$(DEVELOPMENT_LANGUAGE)</string>
+ <key>CFBundleAllowMixedLocalizations</key>
+ <true/>
+
+ <key>CFBundleSupportedPlatforms</key>
+ <array>
+ <string>XROS</string>
+ </array>
+</dict>
+</plist>
diff --git a/mkspecs/macx-visionos-clang/Info.plist.dSYM.in b/mkspecs/macx-visionos-clang/Info.plist.dSYM.in
new file mode 100644
index 0000000000..a8c8d0d4fb
--- /dev/null
+++ b/mkspecs/macx-visionos-clang/Info.plist.dSYM.in
@@ -0,0 +1,18 @@
+<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+ <dict>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.xcode.dsym.$${BUNDLEIDENTIFIER}</string>
+ <key>CFBundlePackageType</key>
+ <string>dSYM</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+!!IF !isEmpty(VERSION)
+ <key>CFBundleShortVersionString</key>
+ <string>$${VER_MAJ}.$${VER_MIN}</string>
+ <key>CFBundleVersion</key>
+ <string>$${VER_MAJ}.$${VER_MIN}.$${VER_PAT}</string>
+!!ENDIF
+ </dict>
+</plist>
diff --git a/mkspecs/macx-visionos-clang/Info.plist.lib b/mkspecs/macx-visionos-clang/Info.plist.lib
new file mode 100644
index 0000000000..34752ec40d
--- /dev/null
+++ b/mkspecs/macx-visionos-clang/Info.plist.lib
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>${QMAKE_SHORT_VERSION}</string>
+ <key>CFBundleSignature</key>
+ <string>${QMAKE_PKGINFO_TYPEINFO}</string>
+ <key>CFBundleVersion</key>
+ <string>${QMAKE_FULL_VERSION}</string>
+ <key>NOTE</key>
+ <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
+</dict>
+</plist>
diff --git a/mkspecs/macx-visionos-clang/qmake.conf b/mkspecs/macx-visionos-clang/qmake.conf
new file mode 100644
index 0000000000..35d9268573
--- /dev/null
+++ b/mkspecs/macx-visionos-clang/qmake.conf
@@ -0,0 +1,29 @@
+#
+# qmake configuration for visionOS
+#
+
+QMAKE_PLATFORM += visionos
+QMAKE_MAC_SDK = xros
+
+device.sdk = xros
+device.target = device
+device.dir_affix = $${device.sdk}
+device.CONFIG = $${device.sdk}
+device.deployment_identifier =
+
+simulator.sdk = xrsimulator
+simulator.target = simulator
+simulator.dir_affix = $${simulator.sdk}
+simulator.CONFIG = $${simulator.sdk}
+simulator.deployment_identifier =
+
+QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 7
+
+include(../common/uikit.conf)
+include(../common/gcc-base-mac.conf)
+include(../common/clang.conf)
+include(../common/clang-mac.conf)
+include(../common/uikit/clang.conf)
+include(../common/uikit/qmake.conf)
+
+load(qt_config)
diff --git a/mkspecs/macx-visionos-clang/qplatformdefs.h b/mkspecs/macx-visionos-clang/qplatformdefs.h
new file mode 100644
index 0000000000..3c0fa239cb
--- /dev/null
+++ b/mkspecs/macx-visionos-clang/qplatformdefs.h
@@ -0,0 +1,4 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "../common/mac/qplatformdefs.h"