summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-12-22 13:26:00 +0100
committerTarja Sundqvist <tarja.sundqvist@qt.io>2022-10-20 17:02:51 +0000
commitab28ff2207e8f33754c79793089dbf943d67736d (patch)
tree8e2d39f0ff69043a2ab601c16fdd6b81ad25b1a1
parent7ff2473dc6926b884b2224389f08ddb21bd231f0 (diff)
iOS: Use generic simulator device for building apps via xcodebuildv5.15.7-lts-lgpl
If Xcode wasn't configured with any simulators the build would fail since we had no device to build for. But we don't need to build for a specific device, we can build for the generic simulator device, just like we do for the non-simulator build. This likely didn't work properly at the time it was first implemented, but now seems to work fine, and is less fragile than the current solution. Running tests still enumerates the available simulators, as that needs a concrete device to run on. Fixes: COIN-777 Change-Id: I50e31c1b350cf83ce348275b467051263dea88a9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit cd2690dcbfc79d4bd7146c410a5edbdc477f92b5) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r--mkspecs/features/uikit/xcodebuild.mk12
-rw-r--r--mkspecs/features/uikit/xcodebuild.prf8
2 files changed, 11 insertions, 9 deletions
diff --git a/mkspecs/features/uikit/xcodebuild.mk b/mkspecs/features/uikit/xcodebuild.mk
index 8b98cdfc60..4416240cf2 100644
--- a/mkspecs/features/uikit/xcodebuild.mk
+++ b/mkspecs/features/uikit/xcodebuild.mk
@@ -58,7 +58,7 @@ debug-%: CONFIGURATION = Debug
MAKEFILE_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
-# Test and build (device) destinations
+# Test device destinations
ifneq ($(filter check%,$(MAKECMDGOALS)),)
ifeq ($(DEVICES),)
$(info Enumerating test destinations (you may override this by setting DEVICES explicitly), please wait...)
@@ -72,14 +72,10 @@ endif
%-device: DEVICES = $(HARDWARE_DEVICES)
GENERIC_DEVICE_DESTINATION := $(EXPORT_GENERIC_DEVICE_DESTINATION)
-GENERIC_SIMULATOR_DESTINATION := $(shell $(MAKEFILE_DIR)devices.py $(EXPORT_DEVICE_FILTER) | tail -n 1)
-ifeq ($(GENERIC_SIMULATOR_DESTINATION),)
- $(error Could not find any device matching '$(EXPORT_DEVICE_FILTER)'.)
-endif
-GENERIC_SIMULATOR_DESTINATION := "id=$(GENERIC_SIMULATOR_DESTINATION)"
+GENERIC_SIMULATOR_DESTINATION := $(EXPORT_GENERIC_SIMULATOR_DESTINATION)
-%-simulator: DESTINATION = $(if $(DESTINATION_ID),"id=$(DESTINATION_ID)",$(GENERIC_SIMULATOR_DESTINATION))
-%-device: DESTINATION = $(if $(DESTINATION_ID),"id=$(DESTINATION_ID)",$(GENERIC_DEVICE_DESTINATION))
+%-simulator: DESTINATION = $(if $(DESTINATION_ID),"id=$(DESTINATION_ID)","$(GENERIC_SIMULATOR_DESTINATION)")
+%-device: DESTINATION = $(if $(DESTINATION_ID),"id=$(DESTINATION_ID)","$(GENERIC_DEVICE_DESTINATION)")
XCODE_VERSION_MAJOR := $(shell xcodebuild -version | grep Xcode | sed -e 's/Xcode //' | sed -e 's/\..*//')
diff --git a/mkspecs/features/uikit/xcodebuild.prf b/mkspecs/features/uikit/xcodebuild.prf
index 01022c7b99..ddf606cda4 100644
--- a/mkspecs/features/uikit/xcodebuild.prf
+++ b/mkspecs/features/uikit/xcodebuild.prf
@@ -53,7 +53,13 @@ watchos {
DEVICE_FILTER = --platform watchOS --minimum-deployment-target $$QMAKE_WATCHOS_DEPLOYMENT_TARGET
GENERIC_DEVICE_DESTINATION = "generic/platform=watchOS"
}
-QMAKE_EXTRA_VARIABLES += DEVICE_SDK SIMULATOR_SDK DEVICE_FILTER GENERIC_DEVICE_DESTINATION
+GENERIC_SIMULATOR_DESTINATION = "$$GENERIC_DEVICE_DESTINATION Simulator"
+
+QMAKE_EXTRA_VARIABLES += \
+ DEVICE_SDK SIMULATOR_SDK \
+ DEVICE_FILTER \
+ GENERIC_DEVICE_DESTINATION \
+ GENERIC_SIMULATOR_DESTINATION
QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/xcodebuild.mk)