Add support for device capabilities on WinRT

WinRT distinguishes between regular capabilities and device
capabilities. For now the latter section are location, microphone,
proximity and webcam. Hence we must add those properly to the generated
manifest.

However, Windows Phone currently combines all of these into the
Capability section, so add a warning if someone uses devicecapabilities
for Windows Phone.

Task-number: QTBUG-37932
Change-Id: I8e9550f29b6afdea3737cc85bdc68344fc04223d
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
This commit is contained in:
Maurice Kalinowski 2014-03-28 09:15:11 +01:00 committed by The Qt Project
parent 423823dd2d
commit f4f23bd5b0

View File

@ -28,6 +28,7 @@
# WINRT_MANIFEST.iconic_tile_icon: Image file for the "iconic" tile template icon. Default provided by the mkspec.
# WINRT_MANIFEST.iconic_tile_small: Image file for the small "iconic" tile template logo. Default provided by the mkspec.
# WINRT_MANIFEST.capabilities: Specifies capabilities to add to the capability list.
# WINRT_MANIFEST.capabilities_device: Specifies device capabilities to add to the capability list. (location, webcam...)
# WINRT_MANIFEST.dependencies: Specifies dependencies required by the package.
# The manifest is generated for each build pass for normal apps, and only once for vcapps.
@ -95,10 +96,14 @@
# Capabilities are given as a string list and may change with the configuration (network, sensors, etc.)
WINRT_MANIFEST.capabilities = $$unique(WINRT_MANIFEST.capabilities)
!isEmpty(WINRT_MANIFEST.capabilities)|winphone {
WINRT_MANIFEST.capabilities_device = $$unique(WINRT_MANIFEST.capabilities_device)
!isEmpty(WINRT_MANIFEST.capabilities)|!isEmpty(WINRT_MANIFEST.capabilities_device)|winphone {
MANIFEST_CAPABILITIES += "<Capabilities>"
for(CAPABILITY, WINRT_MANIFEST.capabilities): \
MANIFEST_CAPABILITIES += " <Capability Name=\"$$CAPABILITY\" />"
!winphone:for(CAPABILITY, WINRT_MANIFEST.capabilities_device): \
MANIFEST_CAPABILITIES += " <DeviceCapability Name=\"$$CAPABILITY\" />"
MANIFEST_CAPABILITIES += "</Capabilities>"
WINRT_MANIFEST.capabilities = $$join(MANIFEST_CAPABILITIES, $$INDENT, $$INDENT)