diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index 8b6d28f5940..bb339489294 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -28,13 +28,11 @@ include(${PROJECT_SOURCE_DIR}/vendor/benchmark.cmake) if(CMAKE_SYSTEM_NAME STREQUAL iOS) set_target_properties(mbgl-vendor-benchmark PROPERTIES XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IOS_DEPLOYMENT_TARGET}") - set_target_properties(mbgl-vendor-benchmark PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "YES") - set_target_properties(mbgl-vendor-benchmark PROPERTIES XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE bitcode) + set_target_properties(mbgl-vendor-benchmark PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") set_target_properties(mbgl-vendor-benchmark PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH $<$:YES>) set_target_properties(mbgl-benchmark PROPERTIES XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IOS_DEPLOYMENT_TARGET}") - set_target_properties(mbgl-benchmark PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "YES") - set_target_properties(mbgl-benchmark PROPERTIES XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE bitcode) + set_target_properties(mbgl-benchmark PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") set_target_properties(mbgl-benchmark PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH $<$:YES>) endif() diff --git a/platform/ios/ios.cmake b/platform/ios/ios.cmake index bf151b921a0..61cb16ea397 100644 --- a/platform/ios/ios.cmake +++ b/platform/ios/ios.cmake @@ -14,8 +14,7 @@ set_target_properties(mbgl-core PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH[vari macro(initialize_ios_target target) set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IOS_DEPLOYMENT_TARGET}") - set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "YES") - set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE bitcode) + set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH $<$:YES>) endmacro() diff --git a/platform/ios/platform/darwin/darwin.xcconfig b/platform/ios/platform/darwin/darwin.xcconfig index 5c0914b337c..414a7b53590 100644 --- a/platform/ios/platform/darwin/darwin.xcconfig +++ b/platform/ios/platform/darwin/darwin.xcconfig @@ -79,7 +79,6 @@ OTHER_CPLUSPLUSFLAGS = $(inherited) -fvisibility=hidden -fcxx-modules OTHER_SWIFT_FLAGS = -warnings-as-errors // User defined -BITCODE_GENERATION_MODE = bitcode CURRENT_COMMIT_HASH = deadbeef CURRENT_SEMANTIC_VERSION = 0.0.0 CURRENT_SHORT_VERSION = 0.0 diff --git a/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.h b/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.h index fd82a4a69dc..2e425df3008 100644 --- a/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.h @@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN @class MGLMapView; @class MGLStyle; +@class MGLContext; typedef struct MGLStyleLayerDrawingContext { CGSize size; @@ -30,7 +31,7 @@ MGL_EXPORT #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" #if TARGET_OS_IPHONE -@property (nonatomic, readonly) EAGLContext *context; +@property (nonatomic, readonly) MGLContext *context; #else @property (nonatomic, readonly) CGLContextObj context; #endif diff --git a/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.mm b/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.mm index 8502a3ff6dc..3016252e9d7 100644 --- a/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.mm +++ b/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.mm @@ -76,7 +76,7 @@ - (MGLMapView *)mapView { } #if TARGET_OS_IPHONE -- (EAGLContext *)context { +- (MGLContext *)context { return self.mapView.context; } #else diff --git a/platform/ios/platform/darwin/src/MGLReachability.m b/platform/ios/platform/darwin/src/MGLReachability.m index a3c8a57aae8..a6fb265fa08 100644 --- a/platform/ios/platform/darwin/src/MGLReachability.m +++ b/platform/ios/platform/darwin/src/MGLReachability.m @@ -466,7 +466,7 @@ -(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags - (NSString *) description { NSString *description = [NSString stringWithFormat:@"<%@: %p (%@)>", - NSStringFromClass([self class]), (void *) self, [self currentReachabilityFlags]]; + NSStringFromClass([self class]), self, [self currentReachabilityFlags]]; return description; } diff --git a/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.mm b/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.mm index 92071855856..e56d114896b 100644 --- a/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.mm +++ b/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.mm @@ -1291,7 +1291,7 @@ - (id)mgl_jsonExpressionObject { } return self.arguments.mgl_jsonExpressionObject; - } else if (op == (NSString *) [MGLColor class] && [function isEqualToString:@"colorWithRed:green:blue:alpha:"]) { + } else if ([function isEqualToString:@"colorWithRed:green:blue:alpha:"]) { NSArray *arguments = self.arguments.mgl_jsonExpressionObject; return [@[@"rgba"] arrayByAddingObjectsFromArray:arguments]; } else if ([function isEqualToString:@"median:"] || diff --git a/platform/ios/platform/ios/config.cmake b/platform/ios/platform/ios/config.cmake index 7f153558762..53cf7932ab7 100644 --- a/platform/ios/platform/ios/config.cmake +++ b/platform/ios/platform/ios/config.cmake @@ -2,8 +2,7 @@ set(USE_GLES2 ON) macro(initialize_ios_target target) set_xcode_property(${target} IPHONEOS_DEPLOYMENT_TARGET "9.0") - set_xcode_property(${target} ENABLE_BITCODE "YES") - set_xcode_property(${target} BITCODE_GENERATION_MODE bitcode) + set_xcode_property(${target} ENABLE_BITCODE "NO") set_xcode_property(${target} ONLY_ACTIVE_ARCH $<$:YES>) target_compile_options(${target} diff --git a/platform/ios/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/platform/ios/ios.xcodeproj/project.pbxproj index a9cb22b0bcb..7c764fe06aa 100644 --- a/platform/ios/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/platform/ios/ios.xcodeproj/project.pbxproj @@ -3,10 +3,13 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ + 06FC989028DE528A007C9705 /* MetalANGLE in Frameworks */ = {isa = PBXBuildFile; productRef = 06FC988F28DE528A007C9705 /* MetalANGLE */; }; + 06FC989128DE5299007C9705 /* MetalANGLE in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 06FC988E28DE5278007C9705 /* MetalANGLE */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 06FC989328DE52B0007C9705 /* MetalANGLE in Frameworks */ = {isa = PBXBuildFile; productRef = 06FC989228DE52B0007C9705 /* MetalANGLE */; }; 071BBAFF1EE7613E001FB02A /* MGLImageSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 071BBAFD1EE75CD4001FB02A /* MGLImageSource.mm */; }; 071BBB001EE7613F001FB02A /* MGLImageSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 071BBAFD1EE75CD4001FB02A /* MGLImageSource.mm */; }; 071BBB031EE76146001FB02A /* MGLImageSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 071BBAFC1EE75CD4001FB02A /* MGLImageSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -185,7 +188,6 @@ 35E79F201D41266300957B9E /* MGLStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 35E79F1F1D41266300957B9E /* MGLStyleLayer_Private.h */; }; 35E79F211D41266300957B9E /* MGLStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 35E79F1F1D41266300957B9E /* MGLStyleLayer_Private.h */; }; 3E6465D62065767A00685536 /* LimeGreenStyleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E6465D42065767A00685536 /* LimeGreenStyleLayer.m */; }; - 3E8770612074297100B7E842 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 554180411D2E97DE00012372 /* OpenGLES.framework */; }; 3EA93369F61CF70AFA50465D /* MGLRendererConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EA931BC4F087E166D538F21 /* MGLRendererConfiguration.m */; }; 3EA934623AD0000B7D99C3FB /* MGLRendererConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA9337830C7738BF7F5493C /* MGLRendererConfiguration.h */; }; 3EA9363147E77DD29FA06063 /* MGLRendererConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA9337830C7738BF7F5493C /* MGLRendererConfiguration.h */; }; @@ -243,7 +245,6 @@ 550570C722958FB400228ECF /* MGLMapView+Impl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 550570C422958FB300228ECF /* MGLMapView+Impl.mm */; }; 550570C822958FB400228ECF /* MGLMapView+Impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 550570C522958FB400228ECF /* MGLMapView+Impl.h */; }; 550570C922958FB400228ECF /* MGLMapView+Impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 550570C522958FB400228ECF /* MGLMapView+Impl.h */; }; - 550570D22296E96E00228ECF /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA27C24D1CBB3811000B0ECD /* GLKit.framework */; }; 556660CA1E1BF3A900E2C41B /* MGLFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 556660C91E1BF3A900E2C41B /* MGLFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 556660D81E1D085500E2C41B /* MGLVersionNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 556660D71E1D085500E2C41B /* MGLVersionNumber.m */; }; 556660DB1E1D8E8D00E2C41B /* MGLFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 556660C91E1BF3A900E2C41B /* MGLFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -443,7 +444,6 @@ DA1DC99F1CB6E088006E619F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DA1DC99E1CB6E088006E619F /* Assets.xcassets */; }; DA1F8F3D1EBD287B00367E42 /* MGLDocumentationGuideTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA1F8F3C1EBD287B00367E42 /* MGLDocumentationGuideTests.swift */; }; DA2784FC1DF02FF4001D5B8D /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DA2784FB1DF02FF4001D5B8D /* Media.xcassets */; }; - DA27C24E1CBB3811000B0ECD /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA27C24D1CBB3811000B0ECD /* GLKit.framework */; }; DA27C24F1CBB4C11000B0ECD /* MGLSettings_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8847FF1CBAFA6200AB86E3 /* MGLSettings_Private.h */; }; DA2DBBCE1D51E80400D38FF9 /* MGLStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA2DBBCD1D51E80400D38FF9 /* MGLStyleLayerTests.m */; }; DA2E88611CC0382C00F24E7B /* MGLGeometryTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA2E885C1CC0382C00F24E7B /* MGLGeometryTests.mm */; }; @@ -741,6 +741,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( + 06FC989128DE5299007C9705 /* MetalANGLE in Embed Frameworks */, CA94E5FC237D21030037AEA0 /* Mapbox.framework in Embed Frameworks */, ); name = "Embed Frameworks"; @@ -780,6 +781,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 06FC988E28DE5278007C9705 /* MetalANGLE */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = MetalANGLE; path = vendor/MetalANGLE; sourceTree = ""; }; 071BBAFC1EE75CD4001FB02A /* MGLImageSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLImageSource.h; sourceTree = ""; }; 071BBAFD1EE75CD4001FB02A /* MGLImageSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLImageSource.mm; sourceTree = ""; }; 071BBB051EE7761A001FB02A /* MGLImageSourceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLImageSourceTests.m; path = ../../darwin/test/MGLImageSourceTests.m; sourceTree = ""; }; @@ -950,7 +952,6 @@ 4BC576C825E443CE006E06EB /* MGLFaux3DUserLocationAnnotationView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFaux3DUserLocationAnnotationView.mm; sourceTree = ""; }; 550570C422958FB300228ECF /* MGLMapView+Impl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "MGLMapView+Impl.mm"; sourceTree = ""; }; 550570C522958FB400228ECF /* MGLMapView+Impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MGLMapView+Impl.h"; sourceTree = ""; }; - 554180411D2E97DE00012372 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 556660C91E1BF3A900E2C41B /* MGLFoundation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLFoundation.h; sourceTree = ""; wrapsLines = 0; }; 556660D71E1D085500E2C41B /* MGLVersionNumber.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MGLVersionNumber.m; path = ../../darwin/test/MGLVersionNumber.m; sourceTree = ""; }; 5580B459229570A00091291B /* MGLMapView+OpenGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MGLMapView+OpenGL.h"; sourceTree = ""; }; @@ -1110,7 +1111,6 @@ DA1DC99E1CB6E088006E619F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; DA1F8F3C1EBD287B00367E42 /* MGLDocumentationGuideTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MGLDocumentationGuideTests.swift; path = ../../darwin/test/MGLDocumentationGuideTests.swift; sourceTree = ""; }; DA2784FB1DF02FF4001D5B8D /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Media.xcassets; path = ../../darwin/test/Media.xcassets; sourceTree = ""; }; - DA27C24D1CBB3811000B0ECD /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; DA2DBBCC1D51E80400D38FF9 /* MGLStyleLayerTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MGLStyleLayerTests.h; path = ../../darwin/test/MGLStyleLayerTests.h; sourceTree = ""; }; DA2DBBCD1D51E80400D38FF9 /* MGLStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLStyleLayerTests.m; path = ../../darwin/test/MGLStyleLayerTests.m; sourceTree = ""; }; DA2E88511CC036F400F24E7B /* test.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = test.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1383,6 +1383,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 06FC989028DE528A007C9705 /* MetalANGLE in Frameworks */, CA94E5FB237D21030037AEA0 /* Mapbox.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1403,13 +1404,13 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 06FC989328DE52B0007C9705 /* MetalANGLE in Frameworks */, DA0BDD202407C12600DAA576 /* libmbgl-core.a in Frameworks */, CAB369E5237471D600592F74 /* libz.tbd in Frameworks */, DA35D9CE240920AB0013ECB0 /* libmbgl-vendor-csscolorparser.a in Frameworks */, 358B3DBB2359EA0F007BEB26 /* libmbgl-vendor-icu.a in Frameworks */, DA35D9D1240920B60013ECB0 /* libmbgl-vendor-parsedate.a in Frameworks */, 358B3DB92359E4A0007BEB26 /* libsqlite3.tbd in Frameworks */, - DA27C24E1CBB3811000B0ECD /* GLKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1421,7 +1422,6 @@ DA35D9CF240920AC0013ECB0 /* libmbgl-vendor-csscolorparser.a in Frameworks */, DA0BDD1F2407C09C00DAA576 /* libmbgl-vendor-icu.a in Frameworks */, DA35D9D2240920BE0013ECB0 /* libmbgl-vendor-parsedate.a in Frameworks */, - 550570D22296E96E00228ECF /* GLKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1430,7 +1430,6 @@ buildActionMask = 2147483647; files = ( DAA4E4081CBB6C9500178DFB /* Mapbox.framework in Frameworks */, - 3E8770612074297100B7E842 /* OpenGLES.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1870,9 +1869,8 @@ DA1DC9921CB6DF24006E619F /* Frameworks */ = { isa = PBXGroup; children = ( - DA27C24D1CBB3811000B0ECD /* GLKit.framework */, + 06FC988E28DE5278007C9705 /* MetalANGLE */, DA4A26961CB6E795000B7809 /* Mapbox.framework */, - 554180411D2E97DE00012372 /* OpenGLES.framework */, 1F78399D235AA1E600D4D606 /* libmbgl-core.a */, DA35D9CC240920910013ECB0 /* libmbgl-vendor-csscolorparser.a */, 358B3DBA2359EA0F007BEB26 /* libmbgl-vendor-icu.a */, @@ -2683,6 +2681,9 @@ CA94E5FE237D21030037AEA0 /* PBXTargetDependency */, ); name = iosapp; + packageProductDependencies = ( + 06FC988F28DE528A007C9705 /* MetalANGLE */, + ); productName = iosapp; productReference = DA1DC94A1CB6C1C2006E619F /* MapLibre GL.app */; productType = "com.apple.product-type.application"; @@ -2719,6 +2720,9 @@ dependencies = ( ); name = dynamic; + packageProductDependencies = ( + 06FC989228DE52B0007C9705 /* MetalANGLE */, + ); productName = framework; productReference = DA8847D21CBAF91600AB86E3 /* Mapbox.framework */; productType = "com.apple.product-type.framework"; @@ -3616,7 +3620,11 @@ CODE_SIGN_STYLE = Automatic; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Integration Tests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.integration-tests"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Integration Tests/integration-Bridging-Header.h"; @@ -3646,7 +3654,11 @@ CODE_SIGN_STYLE = Automatic; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Integration Tests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.integration-tests"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Integration Tests/integration-Bridging-Header.h"; @@ -3675,7 +3687,10 @@ DEVELOPMENT_TEAM = GJZR2MEM28; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Integration Test Harness/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.Integration-Test-Harness"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -3701,7 +3716,10 @@ DEVELOPMENT_TEAM = GJZR2MEM28; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Integration Test Harness/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.Integration-Test-Harness"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -3711,7 +3729,7 @@ 96AF1AA321B615A3007CB696 /* RelWithDebInfo */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -3726,7 +3744,8 @@ MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SYMROOT = ../../build/ios; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; @@ -3744,7 +3763,10 @@ CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = KBDAWM7T4E; INFOPLIST_FILE = app/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = org.maplibre.maplibregl; PRODUCT_NAME = "MapLibre GL"; PROVISIONING_PROFILE_SPECIFIER = "MapLibre GL TestApp Development"; @@ -3776,7 +3798,10 @@ ); INFOPLIST_FILE = benchmark/Info.plist; LD_GENERATE_MAP_FILE = YES; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = org.maplibre.bench; PRODUCT_NAME = "Bench GL"; PROVISIONING_PROFILE_SPECIFIER = "MapLibre GL Bench Development"; @@ -3788,7 +3813,6 @@ baseConfigurationReference = CAE5AE2B2389FBF000E4A5A1 /* ios.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; - BITCODE_GENERATION_MODE = bitcode; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -3797,7 +3821,11 @@ GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1"; INFOPLIST_FILE = framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); LLVM_LTO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.Mapbox; @@ -3811,7 +3839,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = CAE5AE2B2389FBF000E4A5A1 /* ios.xcconfig */; buildSettings = { - BITCODE_GENERATION_MODE = bitcode; DEFINES_MODULE = YES; DYLIB_CURRENT_VERSION = 15256; HEADER_SEARCH_PATHS = ( @@ -3865,7 +3892,11 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; DEVELOPMENT_TEAM = V6F7X5J9Y7; INFOPLIST_FILE = test/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); OTHER_CFLAGS = "-fvisibility=hidden"; OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", @@ -3904,7 +3935,11 @@ CODE_SIGN_STYLE = Automatic; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Integration Tests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.integration-tests"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Integration Tests/integration-Bridging-Header.h"; @@ -3933,7 +3968,10 @@ DEVELOPMENT_TEAM = GJZR2MEM28; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Integration Test Harness/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.Integration-Test-Harness"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -3984,8 +4022,11 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "iosapp UITests/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "org.maplibre.iosapp-UITests"; @@ -4040,8 +4081,11 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "iosapp UITests/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "org.maplibre.iosapp-UITests"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -4093,8 +4137,11 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "iosapp UITests/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "org.maplibre.iosapp-UITests"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -4149,7 +4196,11 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "bench UITests/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 14.4; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "org.maplibre.bench-UITests"; @@ -4205,7 +4256,11 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "bench UITests/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 14.4; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "org.maplibre.bench-UITests"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -4258,7 +4313,11 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "bench UITests/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 14.4; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "org.maplibre.bench-UITests"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -4271,7 +4330,7 @@ DA1DC95F1CB6C1C2006E619F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -4298,7 +4357,7 @@ DA1DC9601CB6C1C2006E619F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD)"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -4313,7 +4372,8 @@ MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SYMROOT = ../../build/ios; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; @@ -4331,7 +4391,10 @@ CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = KBDAWM7T4E; INFOPLIST_FILE = app/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = org.maplibre.maplibregl; PRODUCT_NAME = "MapLibre GL"; PROVISIONING_PROFILE_SPECIFIER = "MapLibre GL TestApp Development"; @@ -4348,7 +4411,10 @@ CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = KBDAWM7T4E; INFOPLIST_FILE = app/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = org.maplibre.maplibregl; PRODUCT_NAME = "MapLibre GL"; PROVISIONING_PROFILE_SPECIFIER = "MapLibre GL TestApp Development"; @@ -4363,7 +4429,11 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; DEVELOPMENT_TEAM = V6F7X5J9Y7; INFOPLIST_FILE = test/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); OTHER_CFLAGS = "-fvisibility=hidden"; OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", @@ -4392,7 +4462,11 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; DEVELOPMENT_TEAM = V6F7X5J9Y7; INFOPLIST_FILE = test/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); OTHER_CFLAGS = "-fvisibility=hidden"; OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", @@ -4417,7 +4491,6 @@ baseConfigurationReference = CAE5AE2B2389FBF000E4A5A1 /* ios.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; - BITCODE_GENERATION_MODE = bitcode; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -4425,7 +4498,11 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.Mapbox; PRODUCT_NAME = Mapbox; @@ -4439,7 +4516,6 @@ baseConfigurationReference = CAE5AE2B2389FBF000E4A5A1 /* ios.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; - BITCODE_GENERATION_MODE = bitcode; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DEPLOYMENT_POSTPROCESSING = YES; @@ -4449,7 +4525,11 @@ GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1"; INFOPLIST_FILE = framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); LLVM_LTO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.Mapbox; @@ -4486,7 +4566,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = CAE5AE2B2389FBF000E4A5A1 /* ios.xcconfig */; buildSettings = { - BITCODE_GENERATION_MODE = bitcode; DEFINES_MODULE = YES; DYLIB_CURRENT_VERSION = 15256; HEADER_SEARCH_PATHS = ( @@ -4524,7 +4603,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = CAE5AE2B2389FBF000E4A5A1 /* ios.xcconfig */; buildSettings = { - BITCODE_GENERATION_MODE = bitcode; DEFINES_MODULE = YES; DEPLOYMENT_POSTPROCESSING = YES; DYLIB_CURRENT_VERSION = 15256; @@ -4586,7 +4664,10 @@ ); INFOPLIST_FILE = benchmark/Info.plist; LD_GENERATE_MAP_FILE = YES; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = org.maplibre.bench; PRODUCT_NAME = "Bench GL"; PROVISIONING_PROFILE_SPECIFIER = "MapLibre GL Bench Development"; @@ -4618,7 +4699,10 @@ ); INFOPLIST_FILE = benchmark/Info.plist; LD_GENERATE_MAP_FILE = YES; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = org.maplibre.bench; PRODUCT_NAME = "Bench GL"; PROVISIONING_PROFILE_SPECIFIER = "MapLibre GL Bench Development"; @@ -4739,6 +4823,17 @@ defaultConfigurationName = RelWithDebInfo; }; /* End XCConfigurationList section */ + +/* Begin XCSwiftPackageProductDependency section */ + 06FC988F28DE528A007C9705 /* MetalANGLE */ = { + isa = XCSwiftPackageProductDependency; + productName = MetalANGLE; + }; + 06FC989228DE52B0007C9705 /* MetalANGLE */ = { + isa = XCSwiftPackageProductDependency; + productName = MetalANGLE; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = DA1DC9421CB6C1C2006E619F /* Project object */; } diff --git a/platform/ios/platform/ios/scripts/package.sh b/platform/ios/platform/ios/scripts/package.sh index 3614c550d7a..e2f6dabc441 100755 --- a/platform/ios/platform/ios/scripts/package.sh +++ b/platform/ios/platform/ios/scripts/package.sh @@ -247,10 +247,10 @@ if [[ ${BUILD_STATIC} == true ]]; then mkdir "${OUTPUT}/static/${NAME}.framework/Modules" cp -pv platform/ios/framework/modulemap "${OUTPUT}/static/${NAME}.framework/Modules/module.modulemap" fi -if [[ ${BUILD_DYNAMIC} == true && ${BUILD_FOR_DEVICE} == true ]]; then - step "Copying bitcode symbol maps…" - find "${PRODUCTS}/${BUILDTYPE}-iphoneos" -name '*.bcsymbolmap' -type f -exec cp -pv {} "${OUTPUT}/dynamic/" \; -fi +#if [[ ${BUILD_DYNAMIC} == true && ${BUILD_FOR_DEVICE} == true ]]; then +# step "Copying bitcode symbol maps…" +# find "${PRODUCTS}/${BUILDTYPE}-iphoneos" -name '*.bcsymbolmap' -type f -exec cp -pv {} "${OUTPUT}/dynamic/" \; +#fi sed -n -e '/^## /,$p' platform/ios/CHANGELOG.md > "${OUTPUT}/CHANGELOG.md" rm -rf /tmp/mbgl diff --git a/platform/ios/platform/ios/src/MGLMapView+Impl.h b/platform/ios/platform/ios/src/MGLMapView+Impl.h index 232215bd1b9..f1a8337a825 100644 --- a/platform/ios/platform/ios/src/MGLMapView+Impl.h +++ b/platform/ios/platform/ios/src/MGLMapView+Impl.h @@ -6,6 +6,8 @@ #import #import +#import + @class MGLMapView; class MGLMapViewImpl : public mbgl::MapObserver { @@ -18,7 +20,7 @@ class MGLMapViewImpl : public mbgl::MapObserver { virtual mbgl::gfx::RendererBackend& getRendererBackend() = 0; // Returns a handle to the OpenGL context object if this view is rendered with OpenGL. - virtual EAGLContext* getEAGLContext() { + virtual MGLContext* getEAGLContext() { return nullptr; } diff --git a/platform/ios/platform/ios/src/MGLMapView+OpenGL.h b/platform/ios/platform/ios/src/MGLMapView+OpenGL.h index b1c13724cbc..54361d4d5ea 100644 --- a/platform/ios/platform/ios/src/MGLMapView+OpenGL.h +++ b/platform/ios/platform/ios/src/MGLMapView+OpenGL.h @@ -17,11 +17,6 @@ class MGLMapViewOpenGLImpl final : public MGLMapViewImpl, public: void restoreFramebufferBinding(); -#ifdef MGL_RECREATE_GL_IN_AN_EMERGENCY -private: - void emergencyRecreateGL(); -#endif - // Implementation of mbgl::gfx::RendererBackend public: mbgl::gfx::Renderable& getDefaultRenderable() override { @@ -47,7 +42,7 @@ class MGLMapViewOpenGLImpl final : public MGLMapViewImpl, return *this; } - EAGLContext* getEAGLContext() override; + MGLContext* getEAGLContext() override; void setOpaque(bool) override; void display() override; void setPresentsWithTransaction(bool) override; diff --git a/platform/ios/platform/ios/src/MGLMapView+OpenGL.mm b/platform/ios/platform/ios/src/MGLMapView+OpenGL.mm index 340f2a9fd03..57fc1037c6a 100644 --- a/platform/ios/platform/ios/src/MGLMapView+OpenGL.mm +++ b/platform/ios/platform/ios/src/MGLMapView+OpenGL.mm @@ -4,11 +4,7 @@ #include -#import -#import -#import - -@interface MGLMapViewImplDelegate : NSObject +@interface MGLMapViewImplDelegate : NSObject @end @implementation MGLMapViewImplDelegate { @@ -22,7 +18,7 @@ - (instancetype)initWithImpl:(MGLMapViewOpenGLImpl*)impl { return self; } -- (void)glkView:(nonnull GLKView*)view drawInRect:(CGRect)rect { +- (void)mglkView:(MGLKView *)view drawInRect:(CGRect)rect { _impl->render(); } @@ -60,8 +56,8 @@ void bind() override { public: MGLMapViewImplDelegate* delegate = nil; - GLKView *glView = nil; - EAGLContext *context = nil; + MGLKView *glView = nil; + MGLContext *context = nil; const bool atLeastiOS_12_2_0; // We count how often the context was activated/deactivated so that we can truly deactivate it @@ -77,8 +73,8 @@ void bind() override { MGLMapViewOpenGLImpl::~MGLMapViewOpenGLImpl() { auto& resource = getResource(); - if (resource.context && [[EAGLContext currentContext] isEqual:resource.context]) { - [EAGLContext setCurrentContext:nil]; + if (resource.context && [[MGLContext currentContext] isEqual:resource.context]) { + [MGLContext setCurrentContext:nil]; } } @@ -89,22 +85,30 @@ void bind() override { } void MGLMapViewOpenGLImpl::setPresentsWithTransaction(const bool value) { - auto& resource = getResource(); - CAEAGLLayer* eaglLayer = MGL_OBJC_DYNAMIC_CAST(resource.glView.layer, CAEAGLLayer); - eaglLayer.presentsWithTransaction = value; + // No-op on Metal. } void MGLMapViewOpenGLImpl::display() { auto& resource = getResource(); - // Calling `display` here directly causes the stuttering bug (if - // `presentsWithTransaction` is `YES` - see above) - // as reported in https://github.com/mapbox/mapbox-gl-native-ios/issues/350 - // - // Since we use `presentsWithTransaction` to synchronize with UIView - // annotations, we now let the system handle when the view is rendered. This - // has the potential to increase latency - [resource.glView setNeedsDisplay]; + // See https://github.com/mapbox/mapbox-gl-native/issues/14232 + // glClear can be blocked for 1 second. This code is an "escape hatch", + // an attempt to detect this situation and rebuild the GL views. + if (mapView.enablePresentsWithTransaction && resource.atLeastiOS_12_2_0) { + CFTimeInterval before = CACurrentMediaTime(); + [resource.glView display]; + CFTimeInterval after = CACurrentMediaTime(); + + if (after - before >= 1.0) { +#ifdef MGL_RECREATE_GL_IN_AN_EMERGENCY + dispatch_async(dispatch_get_main_queue(), ^{ + emergencyRecreateGL(); + }); +#endif + } + } else { + [resource.glView display]; + } } void MGLMapViewOpenGLImpl::createView() { @@ -114,22 +118,21 @@ void bind() override { } if (!resource.context) { - resource.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; + resource.context = [[MGLContext alloc] initWithAPI:kMGLRenderingAPIOpenGLES2]; assert(resource.context); } - resource.glView = [[GLKView alloc] initWithFrame:mapView.bounds context:resource.context]; + resource.glView = [[MGLKView alloc] initWithFrame:mapView.bounds context:resource.context]; resource.glView.delegate = resource.delegate; resource.glView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; resource.glView.contentScaleFactor = contentScaleFactor(); resource.glView.contentMode = UIViewContentModeCenter; - resource.glView.drawableStencilFormat = GLKViewDrawableStencilFormat8; - resource.glView.drawableDepthFormat = GLKViewDrawableDepthFormat16; + resource.glView.drawableStencilFormat = MGLDrawableStencilFormat8; + resource.glView.drawableDepthFormat = MGLDrawableDepthFormat16; resource.glView.opaque = mapView.opaque; resource.glView.layer.opaque = mapView.opaque; - resource.glView.enableSetNeedsDisplay = YES; - CAEAGLLayer* eaglLayer = MGL_OBJC_DYNAMIC_CAST(resource.glView.layer, CAEAGLLayer); - eaglLayer.presentsWithTransaction = NO; + resource.glView.layer.sublayers.firstObject.zPosition = -10; + resource.glView.enableSetNeedsDisplay = NO; [mapView insertSubview:resource.glView atIndex:0]; } @@ -140,51 +143,9 @@ void bind() override { } void MGLMapViewOpenGLImpl::deleteView() { - auto& resource = getResource(); - [resource.glView deleteDrawable]; + // No-op on Metal } -#ifdef MGL_RECREATE_GL_IN_AN_EMERGENCY -// TODO: Fix or remove -// See https://github.com/mapbox/mapbox-gl-native/issues/14232 -void MGLMapViewOpenGLImpl::emergencyRecreateGL() { - auto& resource = getResource(); - MGLLogError(@"Rendering took too long - creating GL views"); - - CAEAGLLayer* eaglLayer = MGL_OBJC_DYNAMIC_CAST(resource.glView.layer, CAEAGLLayer); - eaglLayer.presentsWithTransaction = NO; - - [mapView pauseRendering:nil]; - - // Just performing a pauseRendering:/resumeRendering: pair isn't sufficient - in this case - // we can still get errors when calling bindDrawable. Here we completely - // recreate the GLKView - - [mapView.userLocationAnnotationView removeFromSuperview]; - [resource.glView removeFromSuperview]; - - // Recreate the view - resource.glView = nil; - createView(); - - if (mapView.annotationContainerView) { - [resource.glView insertSubview:mapView.annotationContainerView atIndex:0]; - } - - [mapView updateUserLocationAnnotationView]; - - // Do not bind...yet - - if (mapView.window) { - [mapView resumeRendering:nil]; - eaglLayer = MGL_OBJC_DYNAMIC_CAST(resource.glView.layer, CAEAGLLayer); - eaglLayer.presentsWithTransaction = mapView.enablePresentsWithTransaction; - } else { - MGLLogDebug(@"No window - skipping resumeRendering"); - } -} -#endif - mbgl::gl::ProcAddress MGLMapViewOpenGLImpl::getExtensionFunctionPointer(const char* name) { static CFBundleRef framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengles")); if (!framework) { @@ -201,7 +162,7 @@ void bind() override { return; } - [EAGLContext setCurrentContext:resource.context]; + [MGLContext setCurrentContext:resource.context]; } void MGLMapViewOpenGLImpl::deactivate() { @@ -210,7 +171,7 @@ void bind() override { return; } - [EAGLContext setCurrentContext:nil]; + [MGLContext setCurrentContext:nil]; } /// This function is called before we start rendering, when iOS invokes our rendering method. @@ -248,7 +209,7 @@ void bind() override { static_cast(mapView.bounds.size.height * scaleFactor) }; } -EAGLContext* MGLMapViewOpenGLImpl::getEAGLContext() { +MGLContext* MGLMapViewOpenGLImpl::getEAGLContext() { auto& resource = getResource(); return resource.context; } diff --git a/platform/ios/platform/ios/src/MGLMapView.mm b/platform/ios/platform/ios/src/MGLMapView.mm index d6bcfef83f0..642bd392561 100644 --- a/platform/ios/platform/ios/src/MGLMapView.mm +++ b/platform/ios/platform/ios/src/MGLMapView.mm @@ -990,54 +990,12 @@ - (void)setOpaque:(BOOL)opaque } } -- (void)updateViewsWithCurrentUpdateParameters { - // Update UIKit elements, prior to rendering - [self updateUserLocationAnnotationView]; - [self updateAnnotationViews]; - [self updateCalloutView]; -} - -- (BOOL)renderSync +- (void)renderSync { - BOOL hasPendingBlocks = (self.pendingCompletionBlocks.count > 0); - - if (!self.needsDisplayRefresh && !hasPendingBlocks) { - return NO; - } - - BOOL needsRender = self.needsDisplayRefresh; - - self.needsDisplayRefresh = NO; - - if (!self.dormant && needsRender) + if (!self.dormant && _rendererFrontend && !CGRectIsEmpty(self.frame)) { - // It's important to call this *before* `_rendererFrontend->render()`, as - // that function saves the current `updateParameters` before rendering. If this - // occurs after then the views will be a frame behind. - // - // The update parameters will have been updated earlier, for example by - // calls to easeTo, flyTo, called from gesture handlers. - - [self updateViewsWithCurrentUpdateParameters]; - - if (_rendererFrontend) { - - _rendererFrontend->render(); - - } - - } - - if (hasPendingBlocks) { - // Call any pending completion blocks. This is primarily to ensure - // that annotations are in the expected position after core rendering - // and map update. - // - // TODO: Consider using this same mechanism for delegate callbacks. - [self processPendingBlocks]; + _rendererFrontend->render(); } - - return YES; } // This gets called when the view dimension changes, e.g. because the device is being rotated. @@ -1281,11 +1239,22 @@ - (void)updateFromDisplayLink:(CADisplayLink *)displayLink return; } - if (self.needsDisplayRefresh || (self.pendingCompletionBlocks.count > 0)) + if (_needsDisplayRefresh || (self.pendingCompletionBlocks.count > 0)) { - // UIView update logic has moved into `renderSync` above, which now gets - // triggered by a call to setNeedsDisplay. - // See MGLMapViewOpenGLImpl::display() for more details + _needsDisplayRefresh = NO; + + // Update UIKit elements, prior to rendering + [self updateUserLocationAnnotationView]; + [self updateAnnotationViews]; + [self updateCalloutView]; + + // Call any pending completion blocks. This is primarily to ensure + // that annotations are in the expected position after core rendering + // and map update. + // + // TODO: Consider using this same mechanism for delegate callbacks. + [self processPendingBlocks]; + _mbglView->display(); } @@ -1316,7 +1285,7 @@ - (void)setNeedsRerender { MGLAssertIsMainThread(); - self.needsDisplayRefresh = YES; + _needsDisplayRefresh = YES; } - (void)willTerminate @@ -1382,7 +1351,7 @@ - (void)validateDisplayLink _displayLink = [self.window.screen displayLinkWithTarget:self selector:@selector(updateFromDisplayLink:)]; [self updateDisplayLinkPreferredFramesPerSecond]; [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; - self.needsDisplayRefresh = YES; + _needsDisplayRefresh = YES; [self updateFromDisplayLink:_displayLink]; } else if ( ! isVisible && _displayLink) @@ -1412,21 +1381,7 @@ - (void)updateDisplayLinkPreferredFramesPerSecond newFrameRate = _preferredFramesPerSecond; } - if (@available(iOS 10.0, *)) - { - _displayLink.preferredFramesPerSecond = newFrameRate; - } - else - { - // CADisplayLink.frameInterval does not support more than 60 FPS (and - // no device that supports >60 FPS ever supported iOS 9). - NSInteger maximumFrameRate = 60; - - // `0` is an alias for maximum frame rate. - newFrameRate = newFrameRate ?: maximumFrameRate; - - _displayLink.preferredFramesPerSecond = maximumFrameRate / MIN(newFrameRate, maximumFrameRate); - } + _displayLink.preferredFramesPerSecond = newFrameRate; } - (void)setPreferredFramesPerSecond:(MGLMapViewPreferredFramesPerSecond)preferredFramesPerSecond @@ -1682,6 +1637,8 @@ - (void)willResignActive:(NSNotification *)notification // We want to pause the rendering [self stopDisplayLink]; +// self.lastSnapshotImage = _mbglView->snapshot(); + // For OpenGL this calls glFinish as recommended in // https://developer.apple.com/library/archive/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/ImplementingaMultitasking-awareOpenGLESApplication/ImplementingaMultitasking-awareOpenGLESApplication.html#//apple_ref/doc/uid/TP40008793-CH5-SW1 // reduceMemoryUse(), calls performCleanup(), which calls glFinish @@ -1775,7 +1732,7 @@ - (void)didBecomeActive:(NSNotification *)notification #pragma mark - GL / display link wake/sleep -- (EAGLContext *)context { +- (MGLContext *)context { return _mbglView->getEAGLContext(); } @@ -7216,8 +7173,8 @@ - (void)attemptBackgroundSnapshot { NSTimeInterval now = CACurrentMediaTime(); if (lastSnapshotTime == 0.0 || (now - lastSnapshotTime > MGLBackgroundSnapshotImageInterval)) { - MGLLogDebug(@"Taking snapshot"); - self.lastSnapshotImage = _mbglView->snapshot(); +// MGLLogDebug(@"Taking snapshot"); +// self.lastSnapshotImage = _mbglView->snapshot(); lastSnapshotTime = now; } } diff --git a/platform/ios/platform/ios/src/MGLMapView_Private.h b/platform/ios/platform/ios/src/MGLMapView_Private.h index a59b01ed7be..5af13b8ea7c 100644 --- a/platform/ios/platform/ios/src/MGLMapView_Private.h +++ b/platform/ios/platform/ios/src/MGLMapView_Private.h @@ -1,3 +1,6 @@ +#import +#import + #import "MGLMapView.h" #import "MGLUserLocationAnnotationView.h" #import "MGLAnnotationContainerView.h" @@ -24,7 +27,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const _Nonnull MGLUnderlyingMapUna @interface MGLMapView (Private) /// The map view’s OpenGL rendering context. -@property (nonatomic, readonly, nullable) EAGLContext *context; +@property (nonatomic, readonly, nullable) MGLContext *context; /// Currently shown popover representing the selected annotation. @property (nonatomic, nonnull) UIView *calloutViewForSelectedAnnotation; @@ -52,7 +55,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const _Nonnull MGLUnderlyingMapUna - (void)setNeedsRerender; /// Synchronously render a frame of the map. -- (BOOL)renderSync; +- (void)renderSync; - (mbgl::Map &)mbglMap; - (nonnull mbgl::Renderer *)renderer; @@ -71,7 +74,6 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const _Nonnull MGLUnderlyingMapUna @property (nonatomic, nonnull) MGLUserLocationAnnotationView *userLocationAnnotationView; @property (nonatomic, nonnull) MGLAnnotationContainerView *annotationContainerView; @property (nonatomic, readonly) BOOL enablePresentsWithTransaction; -@property (nonatomic, assign) BOOL needsDisplayRefresh; - (BOOL) _opaque; diff --git a/platform/ios/platform/ios/toolchain.cmake b/platform/ios/platform/ios/toolchain.cmake index edf5a106e5a..df22db77aeb 100644 --- a/platform/ios/platform/ios/toolchain.cmake +++ b/platform/ios/platform/ios/toolchain.cmake @@ -84,7 +84,7 @@ # # DEPLOYMENT_TARGET: Minimum SDK version to target. Default 2.0 on watchOS and 9.0 on tvOS+iOS # -# ENABLE_BITCODE: (1|0) Enables or disables bitcode support. Default 1 (true) +# ENABLE_BITCODE: (1|0) Enables or disables bitcode support. Default 0 (false) # # ENABLE_ARC: (1|0) Enables or disables ARC support. Default 1 (true, ARC enabled by default) # @@ -490,12 +490,8 @@ elseif(DEFINED CMAKE_OSX_SYSROOT_INT) endif() # Use bitcode or not -if(NOT DEFINED ENABLE_BITCODE AND NOT ARCHS MATCHES "((^|;|, )(i386|x86_64))+") - # Unless specified, enable bitcode support by default - message(STATUS "[DEFAULTS] Enabling bitcode support by default. ENABLE_BITCODE not provided!") - set(ENABLE_BITCODE TRUE) -elseif(NOT DEFINED ENABLE_BITCODE) - message(STATUS "[DEFAULTS] Disabling bitcode support by default on simulators. ENABLE_BITCODE not provided for override!") +if(NOT DEFINED ENABLE_BITCODE) + message(STATUS "[DEFAULTS] Disabling bitcode support by default as it's deprecated. ENABLE_BITCODE not provided for override!") set(ENABLE_BITCODE FALSE) endif() set(ENABLE_BITCODE_INT ${ENABLE_BITCODE} CACHE BOOL diff --git a/platform/ios/platform/ios/vendor/MetalANGLE/Package.swift b/platform/ios/platform/ios/vendor/MetalANGLE/Package.swift new file mode 100644 index 00000000000..009486b8aaa --- /dev/null +++ b/platform/ios/platform/ios/vendor/MetalANGLE/Package.swift @@ -0,0 +1,19 @@ +// swift-tools-version:5.6 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "MetalANGLE", + platforms: [.iOS(.v10)], + products: [ + .library(name: "MetalANGLE", targets: ["MetalANGLE"]), + ], + targets: [ + .binaryTarget( + name: "MetalANGLE", + url: "https://github.com/username0x0a/metalangle/releases/download/gles3-0.0.7/MetalANGLE.zip", + checksum: "848d6ebde5d474786cf82569a466c62c60f67c142f5e1119c51032ff55d9b2bb" + ), + ] +) diff --git a/platform/ios/platform/ios/vendor/MetalANGLE/Sources/MetalANGLE/Empty.swift b/platform/ios/platform/ios/vendor/MetalANGLE/Sources/MetalANGLE/Empty.swift new file mode 100644 index 00000000000..774b4e2041e --- /dev/null +++ b/platform/ios/platform/ios/vendor/MetalANGLE/Sources/MetalANGLE/Empty.swift @@ -0,0 +1 @@ +// Nothing to do here diff --git a/render-test/CMakeLists.txt b/render-test/CMakeLists.txt index cb00f19e17a..ab61ff4b93d 100644 --- a/render-test/CMakeLists.txt +++ b/render-test/CMakeLists.txt @@ -20,8 +20,7 @@ add_library( if(CMAKE_SYSTEM_NAME STREQUAL iOS) set_target_properties(mbgl-render-test PROPERTIES XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IOS_DEPLOYMENT_TARGET}") - set_target_properties(mbgl-render-test PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "YES") - set_target_properties(mbgl-render-test PROPERTIES XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE bitcode) + set_target_properties(mbgl-render-test PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") set_target_properties(mbgl-render-test PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH $<$:YES>) endif() diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp index 99043624acb..b54066366d7 100644 --- a/src/mbgl/gl/context.cpp +++ b/src/mbgl/gl/context.cpp @@ -220,10 +220,8 @@ UniqueTexture Context::createUniqueTexture() { } bool Context::supportsVertexArrays() const { - return vertexArray && - vertexArray->genVertexArrays && - vertexArray->bindVertexArray && - vertexArray->deleteVertexArrays; + // TODO: Metal: Metal does not work with vertex arrays. + return false; } VertexArray Context::createVertexArray() { diff --git a/src/mbgl/gl/renderer_backend.cpp b/src/mbgl/gl/renderer_backend.cpp index 1f52ce06a9b..a3da9d54e9b 100644 --- a/src/mbgl/gl/renderer_backend.cpp +++ b/src/mbgl/gl/renderer_backend.cpp @@ -33,6 +33,9 @@ void RendererBackend::assumeFramebufferBinding(const gl::FramebufferID fbo) { void RendererBackend::assumeViewport(int32_t x, int32_t y, const Size& size) { getContext().viewport.setCurrentValue({ x, y, size }); + if (gl::value::Viewport::Get() != getContext().viewport.getCurrentValue()) { + gl::value::Viewport::Set(getContext().viewport.getCurrentValue()); + } assert(gl::value::Viewport::Get() == getContext().viewport.getCurrentValue()); } @@ -54,6 +57,9 @@ void RendererBackend::setFramebufferBinding(const gl::FramebufferID fbo) { void RendererBackend::setViewport(int32_t x, int32_t y, const Size& size) { getContext().viewport = { x, y, size }; + if (gl::value::Viewport::Get() != getContext().viewport.getCurrentValue()) { + gl::value::Viewport::Set(getContext().viewport.getCurrentValue()); + } assert(gl::value::Viewport::Get() == getContext().viewport.getCurrentValue()); } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 466b3c0c93a..1f2980f58ae 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -189,13 +189,11 @@ include(${PROJECT_SOURCE_DIR}/vendor/googletest.cmake) if(CMAKE_SYSTEM_NAME STREQUAL iOS) set_target_properties(mbgl-vendor-googletest PROPERTIES XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IOS_DEPLOYMENT_TARGET}") - set_target_properties(mbgl-vendor-googletest PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "YES") - set_target_properties(mbgl-vendor-googletest PROPERTIES XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE bitcode) + set_target_properties(mbgl-vendor-googletest PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") set_target_properties(mbgl-vendor-googletest PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH $<$:YES>) set_target_properties(mbgl-test PROPERTIES XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IOS_DEPLOYMENT_TARGET}") - set_target_properties(mbgl-test PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "YES") - set_target_properties(mbgl-test PROPERTIES XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE bitcode) + set_target_properties(mbgl-test PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") set_target_properties(mbgl-test PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH $<$:YES>) endif()