diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2020-02-24 16:23:58 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2020-02-27 17:14:20 -0800 |
commit | bd252e16a3574efd11cca57917f52e6d1b2dd0a2 (patch) | |
tree | 41d6f40a38491ab4b023085162f071c3786d9203 | |
parent | a04b4dbf52e270613df0fc6eb4e9ee1f7cfdc09b (diff) | |
download | qtlocation-mapboxgl-bd252e16a3574efd11cca57917f52e6d1b2dd0a2.tar.gz |
[ios, macos] Cleaned up iOS, macOS CMake configuration
-rw-r--r-- | platform/ios/ios.cmake | 6 | ||||
-rw-r--r-- | platform/macos/macos.cmake | 115 |
2 files changed, 27 insertions, 94 deletions
diff --git a/platform/ios/ios.cmake b/platform/ios/ios.cmake index 91489dbba9..a662cac13f 100644 --- a/platform/ios/ios.cmake +++ b/platform/ios/ios.cmake @@ -33,12 +33,11 @@ target_sources( PRIVATE ${PROJECT_SOURCE_DIR}/platform/darwin/src/async_task.cpp ${PROJECT_SOURCE_DIR}/platform/darwin/src/collator.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/native_apple_interface.m ${PROJECT_SOURCE_DIR}/platform/darwin/src/http_file_source.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/native_apple_interface.m ${PROJECT_SOURCE_DIR}/platform/darwin/src/image.mm ${PROJECT_SOURCE_DIR}/platform/darwin/src/local_glyph_rasterizer.mm ${PROJECT_SOURCE_DIR}/platform/darwin/src/logging_nslog.mm + ${PROJECT_SOURCE_DIR}/platform/darwin/src/native_apple_interface.m ${PROJECT_SOURCE_DIR}/platform/darwin/src/nsthread.mm ${PROJECT_SOURCE_DIR}/platform/darwin/src/number_format.mm ${PROJECT_SOURCE_DIR}/platform/darwin/src/reachability.m @@ -47,6 +46,7 @@ target_sources( ${PROJECT_SOURCE_DIR}/platform/darwin/src/timer.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/gfx/headless_backend.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/gfx/headless_frontend.cpp + ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/layermanager/layer_manager.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/map/map_snapshotter.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/storage/asset_file_source.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/storage/database_file_source.cpp @@ -66,8 +66,6 @@ target_sources( ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/util/png_writer.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/util/thread_local.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/util/utf.cpp - ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/util/thread_local.cpp - ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/layermanager/layer_manager.cpp ) target_include_directories( diff --git a/platform/macos/macos.cmake b/platform/macos/macos.cmake index da89a67fff..61b6a33be9 100644 --- a/platform/macos/macos.cmake +++ b/platform/macos/macos.cmake @@ -1,98 +1,47 @@ -find_package(OpenGL REQUIRED) +if(NOT DEFINED MACOSX_DEPLOYMENT_TARGET) + set(MACOSX_DEPLOYMENT_TARGET "10.11") +endif() -target_compile_definitions( - mbgl-core - PUBLIC GL_SILENCE_DEPRECATION -) +set_target_properties(mbgl-core PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES) + +if(MBGL_WITH_OPENGL) + find_package(OpenGL REQUIRED) + + target_compile_definitions( + mbgl-core + PUBLIC GL_SILENCE_DEPRECATION + ) + target_sources( + mbgl-core + PRIVATE + ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/gl/headless_backend.cpp + ${PROJECT_SOURCE_DIR}/platform/darwin/src/gl_functions.cpp ${PROJECT_SOURCE_DIR}/platform/darwin/src/headless_backend_cgl.mm + ) + target_link_libraries( + mbgl-core + PRIVATE OpenGL::GL + ) +endif() target_sources( mbgl-core PRIVATE - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLAccountManager.m - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLAttributedExpression.m - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLAttributionInfo.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLBackgroundStyleLayer.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLCircleStyleLayer.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLClockDirectionFormatter.m - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLCompassDirectionFormatter.m - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLComputedShapeSource.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLCoordinateFormatter.m - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLDistanceFormatter.m - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLFeature.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLFillExtrusionStyleLayer.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLFillStyleLayer.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLForegroundStyleLayer.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLFoundation.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLGeometry.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLHeatmapStyleLayer.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLHillshadeStyleLayer.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLImageSource.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLLight.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLLineStyleLayer.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLLoggingConfiguration.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLMapCamera.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLMapSnapshotter.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLMultiPoint.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLNetworkConfiguration.m - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLOfflinePack.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLOfflineStorage.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLOpenGLStyleLayer.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLPointAnnotation.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLPointCollection.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLPolygon.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLPolyline.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLRasterDEMSource.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLRasterStyleLayer.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLRasterTileSource.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLRendererConfiguration.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLSDKMetricsManager.m - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLShape.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLShapeCollection.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLShapeOfflineRegion.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLShapeSource.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLSource.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLStyle.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLStyleLayer.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLStyleLayerManager.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLStyleValue.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLSymbolStyleLayer.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLTilePyramidOfflineRegion.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLTileSource.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLTypes.m - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLVectorStyleLayer.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLVectorTileSource.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/NSArray+MGLAdditions.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/NSBundle+MGLAdditions.m - ${PROJECT_SOURCE_DIR}/platform/darwin/src/NSCoder+MGLAdditions.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/NSDate+MGLAdditions.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/NSDictionary+MGLAdditions.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/NSExpression+MGLAdditions.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/NSPredicate+MGLAdditions.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/NSString+MGLAdditions.m - ${PROJECT_SOURCE_DIR}/platform/darwin/src/NSURL+MGLAdditions.m - ${PROJECT_SOURCE_DIR}/platform/darwin/src/NSValue+MGLAdditions.m - ${PROJECT_SOURCE_DIR}/platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm ${PROJECT_SOURCE_DIR}/platform/darwin/src/async_task.cpp ${PROJECT_SOURCE_DIR}/platform/darwin/src/collator.mm - ${PROJECT_SOURCE_DIR}/platform/darwin/src/gl_functions.cpp - ${PROJECT_SOURCE_DIR}/platform/darwin/src/headless_backend_cgl.mm ${PROJECT_SOURCE_DIR}/platform/darwin/src/http_file_source.mm ${PROJECT_SOURCE_DIR}/platform/darwin/src/image.mm ${PROJECT_SOURCE_DIR}/platform/darwin/src/local_glyph_rasterizer.mm ${PROJECT_SOURCE_DIR}/platform/darwin/src/logging_nslog.mm + ${PROJECT_SOURCE_DIR}/platform/darwin/src/native_apple_interface.m ${PROJECT_SOURCE_DIR}/platform/darwin/src/nsthread.mm ${PROJECT_SOURCE_DIR}/platform/darwin/src/number_format.mm ${PROJECT_SOURCE_DIR}/platform/darwin/src/reachability.m ${PROJECT_SOURCE_DIR}/platform/darwin/src/run_loop.cpp ${PROJECT_SOURCE_DIR}/platform/darwin/src/string_nsstring.mm ${PROJECT_SOURCE_DIR}/platform/darwin/src/timer.cpp - ${PROJECT_SOURCE_DIR}/platform/darwin/src/native_apple_interface.m - ${PROJECT_SOURCE_DIR}/platform/darwin/src/MGLNetworkIntegrationManager.m ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/gfx/headless_backend.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/gfx/headless_frontend.cpp - ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/gl/headless_backend.cpp + ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/layermanager/layer_manager.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/map/map_snapshotter.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/storage/asset_file_source.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/storage/database_file_source.cpp @@ -112,21 +61,8 @@ target_sources( ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/util/png_writer.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/util/thread_local.cpp ${PROJECT_SOURCE_DIR}/platform/default/src/mbgl/util/utf.cpp - ${PROJECT_SOURCE_DIR}/platform/macos/src/MGLAnnotationImage.m - ${PROJECT_SOURCE_DIR}/platform/macos/src/MGLAttributionButton.mm - ${PROJECT_SOURCE_DIR}/platform/macos/src/MGLCompassCell.m - ${PROJECT_SOURCE_DIR}/platform/macos/src/MGLMapView+IBAdditions.mm - ${PROJECT_SOURCE_DIR}/platform/macos/src/MGLMapView+Impl.mm - ${PROJECT_SOURCE_DIR}/platform/macos/src/MGLMapView+OpenGL.mm - ${PROJECT_SOURCE_DIR}/platform/macos/src/MGLMapView.mm - ${PROJECT_SOURCE_DIR}/platform/macos/src/MGLOpenGLLayer.mm - ${PROJECT_SOURCE_DIR}/platform/macos/src/NSColor+MGLAdditions.mm - ${PROJECT_SOURCE_DIR}/platform/macos/src/NSImage+MGLAdditions.mm - ${PROJECT_SOURCE_DIR}/platform/macos/src/NSProcessInfo+MGLAdditions.m ) -set_target_properties(mbgl-core PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES) - target_compile_options(mbgl-core PRIVATE -fobjc-arc) # FIXME: Should not be needed, but now needed by node because of the headless frontend. @@ -150,7 +86,6 @@ target_link_libraries( "-framework CoreGraphics" "-framework CoreLocation" "-framework SystemConfiguration" - OpenGL::GL mbgl-vendor-icu sqlite3 z |