summaryrefslogtreecommitdiff
path: root/gyp
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-11-22 18:07:06 -0800
committerMinh Nguyễn <mxn@1ec5.org>2015-12-13 17:17:35 -0800
commit0cab7809eb59675be6c3a87a665a2bf0b9a28d75 (patch)
tree490eb9f86113a71be274781f4465c8d32b92dabb /gyp
parentb59f087ea8bd451d7e822bb27d3612974fa5ac77 (diff)
downloadqtlocation-mapboxgl-0cab7809eb59675be6c3a87a665a2bf0b9a28d75.tar.gz
[osx] Rewrote platform-osx and osxapp
platform-osx now vends a real NSView subclass, MGLMapView, that is readily embedded inside a Cocoa application for OS X. MGLMapView is backed by an NSOpenGLLayer for optimal performance and integration with other layer-backed views. It supports keyboard shortcuts and several gestures and hosts attribution, zooming, and rotation controls as subviews. osxapp is now a bona fide Cocoa application that embeds MGLMapView inside a XIB. osxapp has preferences and a share button for tight integration with custom styles. Enabling asynchronous rendering would be more consistent with iOS but increases CPU usage so much, even when idle, that it isn’t worth any performance gain. The bigger issue is that VAOs aren’t being used. make xpackage creates a static library similar to the one created by make ipackage. make clean cleans additional places where build output ends up. The OS X minimum deployment target has been increased from 10.9 to 10.10. osxapp’s window has a full size content view, which requires 10.10. Lightweight generics require iOS 9+ and OS X 10.11 regardless, because it was only in that release that Foundation collection classes started adopting lightweight generics. Shuffled files around and refactored annotations so that iOS and OS X share a good chunk of the annotations code, which now takes advantage of polymorphism. MGLMapView can now display annotations but cannot yet select them. In osxapp, a long press drops a pin, and so does the map view’s context menu. Annotations have NSPopovers as callouts, and their view controllers can be customized. Annotation image alignment rects are respected for hit testing purposes and for positioning the callout anchor. Callouts in osxapp demonstrate the use of bindings to keep callouts in sync with underlying model objects.
Diffstat (limited to 'gyp')
-rw-r--r--gyp/common.gypi2
-rw-r--r--gyp/osx.gyp2
-rw-r--r--gyp/platform-ios.gypi49
-rw-r--r--gyp/platform-osx.gypi63
4 files changed, 88 insertions, 28 deletions
diff --git a/gyp/common.gypi b/gyp/common.gypi
index b3834934d3..6b7f2aea7e 100644
--- a/gyp/common.gypi
+++ b/gyp/common.gypi
@@ -24,7 +24,7 @@
],
'GCC_WARN_PEDANTIC': 'YES',
'GCC_WARN_UNINITIALIZED_AUTOS': 'YES_AGGRESSIVE',
- 'MACOSX_DEPLOYMENT_TARGET': '10.9',
+ 'MACOSX_DEPLOYMENT_TARGET': '10.10',
},
}, {
'cflags_cc': [
diff --git a/gyp/osx.gyp b/gyp/osx.gyp
index 8810144a80..2df9d4818d 100644
--- a/gyp/osx.gyp
+++ b/gyp/osx.gyp
@@ -1,6 +1,6 @@
{
'includes': [
- '../platform/osx/mapboxgl-app.gypi',
+ '../platform/osx/app/mapboxgl-app.gypi',
'../platform/linux/mapboxgl-app.gypi',
'../test/test.gypi',
'../bin/render.gypi',
diff --git a/gyp/platform-ios.gypi b/gyp/platform-ios.gypi
index 5dae54ad90..070dd55c31 100644
--- a/gyp/platform-ios.gypi
+++ b/gyp/platform-ios.gypi
@@ -20,6 +20,29 @@
'../platform/darwin/image.mm',
'../platform/darwin/nsthread.mm',
'../platform/darwin/reachability.m',
+ '../platform/darwin/NSException+MGLAdditions.h',
+ '../platform/darwin/NSString+MGLAdditions.h',
+ '../platform/darwin/NSString+MGLAdditions.m',
+ '../include/mbgl/darwin/MGLTypes.h',
+ '../platform/darwin/MGLTypes.m',
+ '../include/mbgl/darwin/MGLStyle.h',
+ '../platform/darwin/MGLStyle.mm',
+ '../include/mbgl/darwin/MGLGeometry.h',
+ '../platform/darwin/MGLGeometry_Private.h',
+ '../platform/darwin/MGLGeometry.m',
+ '../include/mbgl/darwin/MGLAnnotation.h',
+ '../include/mbgl/darwin/MGLShape.h',
+ '../platform/darwin/MGLShape.m',
+ '../include/mbgl/darwin/MGLMultiPoint.h',
+ '../platform/darwin/MGLMultiPoint_Private.h',
+ '../platform/darwin/MGLMultiPoint.mm',
+ '../include/mbgl/darwin/MGLOverlay.h',
+ '../include/mbgl/darwin/MGLPointAnnotation.h',
+ '../platform/darwin/MGLPointAnnotation.m',
+ '../include/mbgl/darwin/MGLPolyline.h',
+ '../platform/darwin/MGLPolyline.mm',
+ '../include/mbgl/darwin/MGLPolygon.h',
+ '../platform/darwin/MGLPolygon.mm',
'../include/mbgl/ios/Mapbox.h',
'../platform/ios/MGLMapboxEvents.h',
'../platform/ios/MGLMapboxEvents.m',
@@ -31,41 +54,19 @@
'../include/mbgl/ios/MGLAccountManager.h',
'../platform/ios/MGLAccountManager_Private.h',
'../platform/ios/MGLAccountManager.m',
- '../include/mbgl/ios/MGLAnnotation.h',
'../include/mbgl/ios/MGLUserLocation.h',
'../platform/ios/MGLUserLocation_Private.h',
'../platform/ios/MGLUserLocation.m',
'../platform/ios/MGLUserLocationAnnotationView.h',
'../platform/ios/MGLUserLocationAnnotationView.m',
- '../include/mbgl/ios/MGLTypes.h',
- '../platform/ios/MGLTypes.m',
- '../include/mbgl/ios/MGLGeometry.h',
- '../platform/ios/MGLGeometry.m',
- '../include/mbgl/ios/MGLMultiPoint.h',
- '../platform/ios/MGLMultiPoint_Private.h',
- '../platform/ios/MGLMultiPoint.mm',
- '../include/mbgl/ios/MGLOverlay.h',
- '../include/mbgl/ios/MGLPointAnnotation.h',
- '../platform/ios/MGLPointAnnotation.m',
- '../include/mbgl/ios/MGLPolyline.h',
- '../platform/ios/MGLPolyline.m',
- '../include/mbgl/ios/MGLPolygon.h',
- '../platform/ios/MGLPolygon.m',
- '../include/mbgl/ios/MGLShape.h',
- '../platform/ios/MGLShape.m',
'../include/mbgl/ios/MGLAnnotationImage.h',
'../platform/ios/MGLAnnotationImage.m',
- '../include/mbgl/ios/MGLStyle.h',
- '../platform/ios/MGLStyle.mm',
'../platform/ios/MGLCategoryLoader.h',
'../platform/ios/MGLCategoryLoader.m',
'../platform/ios/NSBundle+MGLAdditions.h',
'../platform/ios/NSBundle+MGLAdditions.m',
- '../platform/ios/NSException+MGLAdditions.h',
'../platform/ios/NSProcessInfo+MGLAdditions.h',
'../platform/ios/NSProcessInfo+MGLAdditions.m',
- '../platform/ios/NSString+MGLAdditions.h',
- '../platform/ios/NSString+MGLAdditions.m',
'../platform/ios/vendor/SMCalloutView/SMCalloutView.h',
'../platform/ios/vendor/SMCalloutView/SMCalloutView.m',
'../platform/ios/vendor/Fabric/FABAttributes.h',
@@ -96,6 +97,8 @@
},
'include_dirs': [
+ '../include/mbgl/ios',
+ '../include/mbgl/darwin',
'../include',
'../src',
],
@@ -115,6 +118,8 @@
'direct_dependent_settings': {
'include_dirs': [
+ '../include/mbgl/ios',
+ '../include/mbgl/darwin',
'../include',
],
'mac_bundle_resources': [
diff --git a/gyp/platform-osx.gypi b/gyp/platform-osx.gypi
index 1ccbd3d59b..1462d6e364 100644
--- a/gyp/platform-osx.gypi
+++ b/gyp/platform-osx.gypi
@@ -19,26 +19,76 @@
'../platform/darwin/asset_root.mm',
'../platform/darwin/image.mm',
'../platform/darwin/nsthread.mm',
+ '../platform/darwin/reachability.m',
+ '../platform/darwin/NSException+MGLAdditions.h',
+ '../platform/darwin/NSString+MGLAdditions.h',
+ '../platform/darwin/NSString+MGLAdditions.m',
+ '../include/mbgl/darwin/MGLTypes.h',
+ '../platform/darwin/MGLTypes.m',
+ '../include/mbgl/darwin/MGLStyle.h',
+ '../platform/darwin/MGLStyle.mm',
+ '../include/mbgl/darwin/MGLGeometry.h',
+ '../platform/darwin/MGLGeometry_Private.h',
+ '../platform/darwin/MGLGeometry.m',
+ '../include/mbgl/darwin/MGLAnnotation.h',
+ '../include/mbgl/darwin/MGLShape.h',
+ '../platform/darwin/MGLShape.m',
+ '../include/mbgl/darwin/MGLMultiPoint.h',
+ '../platform/darwin/MGLMultiPoint_Private.h',
+ '../platform/darwin/MGLMultiPoint.mm',
+ '../include/mbgl/darwin/MGLOverlay.h',
+ '../include/mbgl/darwin/MGLPointAnnotation.h',
+ '../platform/darwin/MGLPointAnnotation.m',
+ '../include/mbgl/darwin/MGLPolyline.h',
+ '../platform/darwin/MGLPolyline.mm',
+ '../include/mbgl/darwin/MGLPolygon.h',
+ '../platform/darwin/MGLPolygon.mm',
+ '../include/mbgl/osx/Mapbox.h',
+ '../include/mbgl/osx/MGLAccountManager.h',
+ '../platform/osx/sdk/MGLAccountManager_Private.h',
+ '../platform/osx/sdk/MGLAccountManager.m',
+ '../include/mbgl/osx/MGLMapView.h',
+ '../platform/osx/sdk/MGLMapView_Private.h',
+ '../platform/osx/sdk/MGLMapView.mm',
+ '../include/mbgl/osx/MGLMapView+IBAdditions.h',
+ '../platform/osx/sdk/MGLMapView+IBAdditions.m',
+ '../include/mbgl/osx/MGLMapViewDelegate.h',
+ '../platform/osx/sdk/MGLOpenGLLayer.h',
+ '../platform/osx/sdk/MGLOpenGLLayer.mm',
+ '../platform/osx/sdk/MGLCompassCell.h',
+ '../platform/osx/sdk/MGLCompassCell.m',
+ '../platform/osx/sdk/MGLAttributionButton.h',
+ '../platform/osx/sdk/MGLAttributionButton.m',
+ '../include/mbgl/osx/MGLAnnotationImage.h',
+ '../platform/osx/sdk/MGLAnnotationImage.m',
+ '../platform/osx/sdk/NSBundle+MGLAdditions.h',
+ '../platform/osx/sdk/NSBundle+MGLAdditions.m',
+ '../platform/osx/sdk/NSProcessInfo+MGLAdditions.h',
+ '../platform/osx/sdk/NSProcessInfo+MGLAdditions.m',
+ '../platform/osx/sdk/resources/',
],
'variables': {
'cflags_cc': [
'<@(libuv_cflags)',
'<@(boost_cflags)',
+ '<@(variant_cflags)',
],
'libraries': [
'<@(libuv_static_libs)',
],
'ldflags': [
- '-framework Foundation',
- '-framework ImageIO',
- '-framework CoreServices',
+ '-framework Cocoa',
+ '-framework CoreLocation',
'-framework OpenGL',
- '-framework ApplicationServices',
+ '-framework QuartzCore',
+ '-framework SystemConfiguration',
],
},
'include_dirs': [
+ '../include/mbgl/osx',
+ '../include/mbgl/darwin',
'../include',
'../src',
],
@@ -58,8 +108,13 @@
'direct_dependent_settings': {
'include_dirs': [
+ '../include/mbgl/osx',
+ '../include/mbgl/darwin',
'../include',
],
+ 'mac_bundle_resources': [
+ '<!@(find ../platform/osx/sdk/resources -type f \! -name "README")',
+ ],
},
},
],