mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-04 00:05:25 +08:00
qt 6.5.1 original
This commit is contained in:
21
mkspecs/features/uikit/bitcode.prf
Normal file
21
mkspecs/features/uikit/bitcode.prf
Normal file
@ -0,0 +1,21 @@
|
||||
!versionAtLeast(QMAKE_XCODE_VERSION, 7.0) {
|
||||
warning("You need to update Xcode to version 7 or newer to support bitcode")
|
||||
} else: !macx-xcode {
|
||||
# Simulator builds and all debug builds SHOULD use -fembed-bitcode-marker,
|
||||
# but unfortunately the -fembed-bitcode and -fembed-bitcode-marker driver
|
||||
# flags do not work in conjunction with -Xarch, so we'll have to let it use
|
||||
# the "wrong" flags for now (note that this issue affects only the Makefile
|
||||
# generator). We also don't want the flags to be passed in Xcode builds, as
|
||||
# the Xcode ENABLE_BITCODE setting will take care of that for us.
|
||||
release {
|
||||
QMAKE_CFLAGS += -fembed-bitcode
|
||||
QMAKE_CXXFLAGS += -fembed-bitcode
|
||||
QMAKE_OBJECTIVE_CFLAGS += -fembed-bitcode
|
||||
QMAKE_LFLAGS += -fembed-bitcode
|
||||
} else {
|
||||
QMAKE_CFLAGS += -fembed-bitcode-marker
|
||||
QMAKE_CXXFLAGS += -fembed-bitcode-marker
|
||||
QMAKE_OBJECTIVE_CFLAGS += -fembed-bitcode-marker
|
||||
QMAKE_LFLAGS += -fembed-bitcode-marker
|
||||
}
|
||||
}
|
51
mkspecs/features/uikit/default_post.prf
Normal file
51
mkspecs/features/uikit/default_post.prf
Normal file
@ -0,0 +1,51 @@
|
||||
equals(TEMPLATE, app):qt {
|
||||
# If the application uses Qt, it needs to be an application bundle
|
||||
# to be able to deploy and run on iOS. The only exception to this
|
||||
# is if you're working with a jailbroken device and can run the
|
||||
# resulting binary from the console/over SSH, but that's not a
|
||||
# use-case we care about, so no need to complicate the logic.
|
||||
CONFIG *= app_bundle
|
||||
|
||||
# For Qt applications we want Xcode project files as the generated output,
|
||||
# but since qmake doesn't handle the transition between makefiles and Xcode
|
||||
# project files (which happens when using subdirs), we can't just override
|
||||
# MAKEFILE_GENERATOR. Instead, we generate the Xcode project by spawning a
|
||||
# child qmake process with -spec macx-xcode and let the top level qmake
|
||||
# process generate a wrapper makefile that forwards everything to xcodebuild.
|
||||
equals(MAKEFILE_GENERATOR, UNIX): \
|
||||
CONFIG = xcodebuild $$CONFIG
|
||||
}
|
||||
|
||||
load(default_post)
|
||||
|
||||
macx-xcode {
|
||||
ios:!isEmpty(QMAKE_IOS_TARGETED_DEVICE_FAMILY) {
|
||||
warning("QMAKE_IOS_TARGETED_DEVICE_FAMILY is deprecated; use QMAKE_APPLE_TARGETED_DEVICE_FAMILY")
|
||||
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = $$QMAKE_IOS_TARGETED_DEVICE_FAMILY
|
||||
}
|
||||
|
||||
device_family.name = TARGETED_DEVICE_FAMILY
|
||||
device_family.value = $$QMAKE_APPLE_TARGETED_DEVICE_FAMILY
|
||||
QMAKE_MAC_XCODE_SETTINGS += device_family
|
||||
|
||||
equals(TEMPLATE, app):ios {
|
||||
isEmpty(QMAKE_IOS_LAUNCH_SCREEN) {
|
||||
qmake_launch_screen = LaunchScreen.storyboard
|
||||
qmake_copy_launch_screen.input = $$QMAKESPEC/$$qmake_launch_screen
|
||||
qmake_copy_launch_screen.output = $$OUT_PWD/$${TARGET}.xcodeproj/$$qmake_launch_screen
|
||||
QMAKE_SUBSTITUTES += qmake_copy_launch_screen
|
||||
qmake_launch_screens.files = $$qmake_copy_launch_screen.output
|
||||
} else {
|
||||
qmake_launch_screens.files = $$QMAKE_IOS_LAUNCH_SCREEN
|
||||
}
|
||||
QMAKE_BUNDLE_DATA += qmake_launch_screens
|
||||
}
|
||||
}
|
||||
|
||||
!xcodebuild:equals(TEMPLATE, app):!isEmpty(QMAKE_INFO_PLIST) {
|
||||
# Only link in photo library support if Info.plist contains
|
||||
# NSPhotoLibraryUsageDescription. Otherwise it will be rejected from AppStore.
|
||||
plist_path = $$absolute_path($$QMAKE_INFO_PLIST, $$_PRO_FILE_PWD_)
|
||||
system("/usr/libexec/PlistBuddy -c 'Print NSPhotoLibraryUsageDescription' $$system_quote($$plist_path) &>/dev/null"): \
|
||||
QTPLUGIN += qiosnsphotolibrarysupport
|
||||
}
|
19
mkspecs/features/uikit/default_pre.prf
Normal file
19
mkspecs/features/uikit/default_pre.prf
Normal file
@ -0,0 +1,19 @@
|
||||
sim_and_dev = false
|
||||
!isEmpty(QT_VERSION):qtConfig(simulator_and_device): \
|
||||
sim_and_dev = true
|
||||
|
||||
$$sim_and_dev|contains(QMAKE_MAC_SDK, ^$${device.sdk}.*): \
|
||||
CONFIG += device $${device.sdk}
|
||||
$$sim_and_dev|contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*): \
|
||||
CONFIG += simulator $${simulator.sdk}
|
||||
|
||||
CONFIG += entrypoint
|
||||
|
||||
unset(sim_and_dev)
|
||||
|
||||
load(default_pre)
|
||||
|
||||
# Check for supported Xcode versions
|
||||
!versionAtLeast(QMAKE_XCODE_VERSION, 4.3): \
|
||||
error("This mkspec requires Xcode 4.3 or later")
|
||||
|
37
mkspecs/features/uikit/device_destinations.sh
Normal file
37
mkspecs/features/uikit/device_destinations.sh
Normal file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
# 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
|
||||
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
scheme=$1
|
||||
shift
|
||||
booted_simulator=$($DIR/devices.py --state booted $@ | tail -n 1)
|
||||
echo "SIMULATOR_DEVICES = $booted_simulator"
|
||||
|
||||
xcodebuild test -scheme $scheme -destination 'id=0' -destination-timeout 1 2>&1| sed -n 's/{ \(platform:.*\) }/\1/p' | while read destination; do
|
||||
id=$(echo $destination | sed -n -E 's/.*id:([^ ,]+).*/\1/p')
|
||||
[[ $id == *"placeholder"* ]] && continue
|
||||
|
||||
echo $destination | tr ',' '\n' | while read keyval; do
|
||||
key=$(echo $keyval | cut -d ':' -f 1 | tr '[:lower:]' '[:upper:]')
|
||||
val=$(echo $keyval | cut -d ':' -f 2)
|
||||
echo "%_$id: DESTINATION_${key} = $val"
|
||||
|
||||
if [ $key = 'PLATFORM' ]; then
|
||||
if [ "$val" = "iOS" ]; then
|
||||
echo "HARDWARE_DEVICES += $id"
|
||||
elif [ "$val" = "iOS Simulator" -a "$id" != "$booted_simulator" ]; then
|
||||
echo "SIMULATOR_DEVICES += $id"
|
||||
elif [ "$val" = "tvOS" ]; then
|
||||
echo "HARDWARE_DEVICES += $id"
|
||||
elif [ "$val" = "tvOS Simulator" -a "$id" != "$booted_simulator" ]; then
|
||||
echo "SIMULATOR_DEVICES += $id"
|
||||
elif [ "$val" = "watchOS" ]; then
|
||||
echo "HARDWARE_DEVICES += $id"
|
||||
elif [ "$val" = "watchOS Simulator" -a "$id" != "$booted_simulator" ]; then
|
||||
echo "SIMULATOR_DEVICES += $id"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo
|
||||
done
|
51
mkspecs/features/uikit/devices.py
Normal file
51
mkspecs/features/uikit/devices.py
Normal file
@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (C) 2017 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
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import subprocess
|
||||
from distutils.version import StrictVersion
|
||||
|
||||
def is_available(object):
|
||||
if "isAvailable" in object:
|
||||
return object["isAvailable"] # introduced in Xcode 11
|
||||
else:
|
||||
return "unavailable" not in object["availability"]
|
||||
|
||||
def is_suitable_runtime(runtimes, runtime_name, platform, min_version):
|
||||
for runtime in runtimes:
|
||||
identifier = runtime["identifier"]
|
||||
if (runtime["name"] == runtime_name or identifier == runtime_name) \
|
||||
and is_available(runtime) \
|
||||
and identifier.startswith("com.apple.CoreSimulator.SimRuntime.{}".format(platform)) \
|
||||
and StrictVersion(runtime["version"]) >= min_version:
|
||||
return True
|
||||
return False
|
||||
|
||||
def simctl_runtimes():
|
||||
return json.loads(subprocess.check_output(
|
||||
["/usr/bin/xcrun", "simctl", "list", "runtimes", "--json"]))["runtimes"]
|
||||
|
||||
def simctl_devices():
|
||||
return json.loads(subprocess.check_output(
|
||||
["/usr/bin/xcrun", "simctl", "list", "devices", "--json"]))["devices"]
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--platform', choices=['iOS', 'tvOS', 'watchOS'], required=True)
|
||||
parser.add_argument('--minimum-deployment-target', type=StrictVersion, default='0.0')
|
||||
parser.add_argument('--state',
|
||||
choices=['booted', 'shutdown', 'creating', 'booting', 'shutting-down'], action='append')
|
||||
args = parser.parse_args()
|
||||
|
||||
runtimes = simctl_runtimes()
|
||||
device_dict = simctl_devices()
|
||||
for runtime_name in device_dict:
|
||||
if is_suitable_runtime(runtimes, runtime_name, args.platform, args.minimum_deployment_target):
|
||||
for device in device_dict[runtime_name]:
|
||||
if is_available(device) \
|
||||
and (args.state is None or device["state"].lower() in args.state):
|
||||
print(device["udid"])
|
8
mkspecs/features/uikit/exclusive_builds_post.prf
Normal file
8
mkspecs/features/uikit/exclusive_builds_post.prf
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
xcodebuild {
|
||||
# Prevent qmake from generating empty output dirs for each exclusive build,
|
||||
# as Xcode will do this by itself, and with a different name.
|
||||
QMAKE_DIR_REPLACE =
|
||||
}
|
||||
|
||||
load(exclusive_builds_post)
|
6
mkspecs/features/uikit/gc_binaries.prf
Normal file
6
mkspecs/features/uikit/gc_binaries.prf
Normal file
@ -0,0 +1,6 @@
|
||||
# bitcode (release mode) is incompatible with splitting sections.
|
||||
# We have to explicitly exclude Xcode, as that supports both debug
|
||||
# and release builds in the same project. Xcode already has a settting
|
||||
# for dead code stripping which is enabled by default, so we'll still
|
||||
# strip any libraries build with split sections.
|
||||
!bitcode|if(!macx-xcode:!release): load(gc_binaries)
|
17
mkspecs/features/uikit/resolve_config.prf
Normal file
17
mkspecs/features/uikit/resolve_config.prf
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
xcodebuild {
|
||||
# Xcode project files always support both Debug and Release configurations
|
||||
# and device and simulator targets, so we make sure the wrapper-makefile
|
||||
# also does.
|
||||
CONFIG += debug_and_release simulator_and_device
|
||||
}
|
||||
|
||||
load(resolve_config)
|
||||
|
||||
!macx-xcode:xcodebuild {
|
||||
# Switch the order to make sure that the first Makefile target is the right one
|
||||
!qtConfig(simulator_and_device):contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*): \
|
||||
addExclusiveBuildsProper(simulator_and_device, simulator device)
|
||||
else: \
|
||||
addExclusiveBuildsProper(simulator_and_device, device simulator)
|
||||
}
|
17
mkspecs/features/uikit/sdk.prf
Normal file
17
mkspecs/features/uikit/sdk.prf
Normal file
@ -0,0 +1,17 @@
|
||||
load(sdk)
|
||||
|
||||
macx-xcode {
|
||||
sdk_path_device.name = "QMAKE_MAC_SDK_PATH[sdk=$${device.sdk}*]"
|
||||
sdk_path_device.value = $$xcodeSDKInfo(Path, $${device.sdk})
|
||||
sdk_path_simulator.name = "QMAKE_MAC_SDK_PATH[sdk=$${simulator.sdk}*]"
|
||||
sdk_path_simulator.value = $$xcodeSDKInfo(Path, $${simulator.sdk})
|
||||
QMAKE_MAC_XCODE_SETTINGS += sdk_path_device sdk_path_simulator
|
||||
QMAKE_MAC_SDK_PATH = "$(QMAKE_MAC_SDK_PATH)"
|
||||
|
||||
sdk_platform_path_device.name = "QMAKE_MAC_SDK_PLATFORM_PATH[sdk=$${device.sdk}*]"
|
||||
sdk_platform_path_device.value = $$xcodeSDKInfo(PlatformPath, $${device.sdk})
|
||||
sdk_platform_path_simulator.name = "QMAKE_MAC_SDK_PLATFORM_PATH[sdk=$${simulator.sdk}*]"
|
||||
sdk_platform_path_simulator.value = $$xcodeSDKInfo(PlatformPath, $${simulator.sdk})
|
||||
QMAKE_MAC_XCODE_SETTINGS += sdk_platform_path_device sdk_platform_path_simulator
|
||||
QMAKE_MAC_SDK_PLATFORM_PATH = "$(QMAKE_MAC_SDK_PLATFORM_PATH)"
|
||||
}
|
12
mkspecs/features/uikit/testcase.prf
Normal file
12
mkspecs/features/uikit/testcase.prf
Normal file
@ -0,0 +1,12 @@
|
||||
# Pretend we have a target, even though our template is aux
|
||||
xcodebuild: \
|
||||
CONFIG += have_target
|
||||
|
||||
load(testcase)
|
||||
|
||||
# We provide our own check logic
|
||||
xcodebuild {
|
||||
check.depends =
|
||||
check.commands =
|
||||
QMAKE_EXTRA_TARGETS *= check
|
||||
}
|
3
mkspecs/features/uikit/testcase_targets.prf
Normal file
3
mkspecs/features/uikit/testcase_targets.prf
Normal file
@ -0,0 +1,3 @@
|
||||
# For the xcodebuild wrapper makefile we deal with test targets manually
|
||||
!xcodebuild: \
|
||||
load(testcase_targets)
|
15
mkspecs/features/uikit/watchos_coretext.prf
Normal file
15
mkspecs/features/uikit/watchos_coretext.prf
Normal file
@ -0,0 +1,15 @@
|
||||
# CoreText is documented to be available on watchOS, but the headers aren't present
|
||||
# in the watchOS Simulator SDK like they are supposed to be. Work around the problem
|
||||
# by adding the device SDK's headers to the search path as a fallback.
|
||||
# rdar://25314492, rdar://27844864
|
||||
simulator_system_frameworks = $$xcodeSDKInfo(Path, $${simulator.sdk})/System/Library/Frameworks
|
||||
watchos:simulator:!exists($$simulator_system_frameworks/CoreText.framework/Headers/CoreText.h) {
|
||||
device_system_frameworks = $$xcodeSDKInfo(Path, $${device.sdk})/System/Library/Frameworks
|
||||
for (arch, QMAKE_APPLE_SIMULATOR_ARCHS) {
|
||||
QMAKE_CXXFLAGS += \
|
||||
-Xarch_$${arch} \
|
||||
-F$$simulator_system_frameworks \
|
||||
-Xarch_$${arch} \
|
||||
-F$$device_system_frameworks
|
||||
}
|
||||
}
|
112
mkspecs/features/uikit/xcodebuild.mk
Normal file
112
mkspecs/features/uikit/xcodebuild.mk
Normal file
@ -0,0 +1,112 @@
|
||||
|
||||
# We don't want xcodebuild to run in parallel
|
||||
.NOTPARALLEL:
|
||||
|
||||
# Functions
|
||||
targets = $(foreach target, $(EXPORT_SUBTARGETS), $(target)-$(strip $(1)))
|
||||
toupper = $(shell echo $1 | tr '[:lower:]' '[:upper:]')
|
||||
tolower = $(shell echo $1 | tr '[:upper:]' '[:lower:]')
|
||||
basesdk = $(shell echo $1 | sed 's/[0-9.]*$$//')
|
||||
|
||||
# Explicit comma variable
|
||||
, := ,
|
||||
|
||||
# Default targets
|
||||
first: build
|
||||
all: build_all
|
||||
|
||||
.DEFAULT_GOAL = first
|
||||
|
||||
# Top level targets
|
||||
build: build_first
|
||||
clean: clean_first
|
||||
install: install_first
|
||||
check: check_first
|
||||
distclean: clean_all
|
||||
|
||||
$(EXPORT_SUBTARGETS): % : %-build
|
||||
|
||||
# Generic targets
|
||||
%_first: $(EXPORT_PRE_TARGETDEPS) $(firstword $(call targets, %)) ;
|
||||
%_all: $(EXPORT_PRE_TARGETDEPS) $(call targets, %) ;
|
||||
|
||||
# Actions
|
||||
%-build: ACTION = build
|
||||
%-build: xcodebuild-% ;
|
||||
|
||||
%-clean: ACTION = clean
|
||||
%-clean: xcodebuild-% ;
|
||||
|
||||
%-install: ACTION = install
|
||||
%-install: xcodebuild-% ;
|
||||
|
||||
# Simulator doesn't support archiving
|
||||
%-simulator-install: ACTION = build
|
||||
simulator-install: ACTION = build
|
||||
|
||||
# Limit check to a single configuration
|
||||
%-device-check: check-device ;
|
||||
%-simulator-check: check-simulator ;
|
||||
|
||||
# SDK
|
||||
%-device: SDK = $(DEVICE_SDK)
|
||||
%-simulator: SDK = $(SIMULATOR_SDK)
|
||||
|
||||
# Configuration
|
||||
release-%: CONFIGURATION = Release
|
||||
debug-%: CONFIGURATION = Debug
|
||||
|
||||
MAKEFILE_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
|
||||
# Test device destinations
|
||||
ifneq ($(filter check%,$(MAKECMDGOALS)),)
|
||||
ifeq ($(DEVICES),)
|
||||
$(info Enumerating test destinations (you may override this by setting DEVICES explicitly), please wait...)
|
||||
DESTINATIONS_INCLUDE = /tmp/device_destinations.mk
|
||||
$(shell $(MAKEFILE_DIR)device_destinations.sh $(TARGET) $(EXPORT_DEVICE_FILTER) > $(DESTINATIONS_INCLUDE))
|
||||
include $(DESTINATIONS_INCLUDE)
|
||||
endif
|
||||
endif
|
||||
|
||||
%-simulator: DEVICES = $(firstword $(SIMULATOR_DEVICES))
|
||||
%-device: DEVICES = $(HARDWARE_DEVICES)
|
||||
|
||||
GENERIC_DEVICE_DESTINATION := $(EXPORT_GENERIC_DEVICE_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)")
|
||||
|
||||
XCODE_VERSION_MAJOR := $(shell xcodebuild -version | grep Xcode | sed -e 's/Xcode //' | sed -e 's/\..*//')
|
||||
|
||||
ifeq ($(shell test $(XCODE_VERSION_MAJOR) -gt 7; echo $$?),0)
|
||||
XCODEBUILD_FLAGS += $(shell echo "$(MAKEFLAGS)" | sed -e 's/\([^ ]*\).*/\1/' | grep -qv 's' || echo -quiet)
|
||||
endif
|
||||
|
||||
ifeq ($(shell test $(XCODE_VERSION_MAJOR) -ge 9; echo $$?),0)
|
||||
XCODEBUILD_FLAGS += -allowProvisioningUpdates
|
||||
endif
|
||||
|
||||
# Xcodebuild
|
||||
|
||||
DESTINATION_MESSAGE = "Running $(call tolower,$(CONFIGURATION)) $(ACTION) \
|
||||
on '$(DESTINATION_NAME)' ($(DESTINATION_ID))$(if $(DESTINATION_OS),$(,) $(DESTINATION_PLATFORM) $(DESTINATION_OS),)"
|
||||
|
||||
xcodebuild-%:
|
||||
@$(if $(DESTINATION_NAME), echo $(DESTINATION_MESSAGE),)
|
||||
xcodebuild $(ACTION) $(XCODEBUILD_FLAGS) -project $(TARGET).xcodeproj -scheme $(TARGET) $(if $(SDK), -sdk $(SDK),) $(if $(CONFIGURATION), -configuration $(CONFIGURATION),) $(if $(DESTINATION), -destination $(DESTINATION) -destination-timeout 1,) $(if $(DESTINATION_ID),, ENABLE_ONLY_ACTIVE_RESOURCES=NO) $(if $(INSTALL_ROOT), DSTROOT=$(INSTALL_ROOT),)
|
||||
|
||||
xcodebuild-check-device_%: DESTINATION_ID=$(lastword $(subst _, ,$@))
|
||||
|
||||
# Special check target (requires SECONDEXPANSION due to devices)
|
||||
.SECONDEXPANSION:
|
||||
check-%: ACTION = test
|
||||
check-%: $$(foreach device, $$(DEVICES), xcodebuild-check-device_$$(device)) ;
|
||||
@echo $(if $^, Ran $(call tolower,$(CONFIGURATION)) tests on $(words $^) $(SDK) destination\(s\): $(DEVICES), No compatible test devices found for \'$(SDK)\' SDK && false)
|
||||
|
||||
# Determined by device
|
||||
check-%: SDK =
|
||||
|
||||
# Default to debug for testing
|
||||
check-%: CONFIGURATION = Debug
|
||||
|
77
mkspecs/features/uikit/xcodebuild.prf
Normal file
77
mkspecs/features/uikit/xcodebuild.prf
Normal file
@ -0,0 +1,77 @@
|
||||
|
||||
# For Qt applications we want Xcode project files as the generated output,
|
||||
# but since qmake doesn't handle the transition between makefiles and Xcode
|
||||
# project files (which happens when using subdirs), we can't just override
|
||||
# MAKEFILE_GENERATOR. Instead, we generate the Xcode project by spawing a
|
||||
# child qmake process with -spec macx-xcode and let the top level qmake
|
||||
# process generate a wrapper makefile that forwards everything to xcodebuild.
|
||||
|
||||
TEMPLATE = aux
|
||||
|
||||
SOURCES =
|
||||
OBJECTIVE_SOURCES =
|
||||
RESOURCES =
|
||||
INSTALLS =
|
||||
QMAKE_EXTRA_COMPILERS =
|
||||
|
||||
!mkpath($$OUT_PWD): \
|
||||
error("Failed to create $$OUT_PWD")
|
||||
|
||||
args =
|
||||
prev_arg =
|
||||
for(arg, QMAKE_ARGS) {
|
||||
!equals(arg, "-spec"):!equals(prev_arg, "-spec"): \
|
||||
args += $$system_quote($$arg)
|
||||
prev_arg = $$arg
|
||||
}
|
||||
|
||||
cmd = "$$QMAKE_QMAKE $$system_quote($$_PRO_FILE_) -spec macx-xcode $$args"
|
||||
debug(1, "Generating Xcode project in $$OUT_PWD using '$$cmd'")
|
||||
system("$$QMAKE_CD $$system_quote($$OUT_PWD) && $$cmd")
|
||||
|
||||
QMAKE_EXTRA_VARIABLES += PRE_TARGETDEPS
|
||||
|
||||
# Subtargets
|
||||
|
||||
for(build, BUILDS): \
|
||||
SUBTARGETS += $$eval($${build}.target)
|
||||
QMAKE_EXTRA_VARIABLES += SUBTARGETS
|
||||
|
||||
CONFIG += no_default_goal_deps
|
||||
|
||||
DEVICE_SDK = $${device.sdk}
|
||||
SIMULATOR_SDK = $${simulator.sdk}
|
||||
ios {
|
||||
DEVICE_FILTER = --platform iOS --minimum-deployment-target $$QMAKE_IOS_DEPLOYMENT_TARGET
|
||||
GENERIC_DEVICE_DESTINATION = "generic/platform=iOS"
|
||||
}
|
||||
tvos {
|
||||
DEVICE_FILTER = --platform tvOS --minimum-deployment-target $$QMAKE_TVOS_DEPLOYMENT_TARGET
|
||||
GENERIC_DEVICE_DESTINATION = "generic/platform=tvOS"
|
||||
}
|
||||
watchos {
|
||||
DEVICE_FILTER = --platform watchOS --minimum-deployment-target $$QMAKE_WATCHOS_DEPLOYMENT_TARGET
|
||||
GENERIC_DEVICE_DESTINATION = "generic/platform=watchOS"
|
||||
}
|
||||
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)
|
||||
|
||||
# Distclean
|
||||
|
||||
distfiles = $${TARGET}.xcodeproj
|
||||
for(build, BUILDS): \
|
||||
distfiles += $$title($$eval($${build}.target))
|
||||
distclean_xcodebuild.commands = -$(DEL_FILE) -R $$distfiles
|
||||
|
||||
distclean.depends += clean_all distclean_xcodebuild
|
||||
QMAKE_EXTRA_TARGETS += distclean distclean_xcodebuild
|
||||
|
||||
# Empty exclusive builds, we've set them up manually
|
||||
BUILDS =
|
Reference in New Issue
Block a user