diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-06-03 18:05:04 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-08-05 11:42:22 +0200 |
commit | 692fe1f3ffc8f4364b39c14aa7d90cec2ff5c0a6 (patch) | |
tree | 1d08af7d56e986dba2b548ff9b9a7e1a77c713ed /platform/ios | |
parent | e3ee55b28d0b230d054c9718f79a1f6d685cd62b (diff) | |
download | qtlocation-mapboxgl-692fe1f3ffc8f4364b39c14aa7d90cec2ff5c0a6.tar.gz |
[build] switch to CMake
This is very much a work in progress.
Diffstat (limited to 'platform/ios')
-rw-r--r-- | platform/ios/WorkspaceSettings.xcsettings | 10 | ||||
-rw-r--r-- | platform/ios/bitrise.yml | 1 | ||||
-rw-r--r-- | platform/ios/config.cmake | 60 | ||||
-rw-r--r-- | platform/ios/ios.xcodeproj/project.pbxproj | 88 | ||||
-rw-r--r-- | platform/ios/ios.xcworkspace/contents.xcworkspacedata | 2 | ||||
-rw-r--r-- | platform/ios/platform.gyp | 149 | ||||
-rw-r--r-- | platform/ios/scripts/configure.sh | 17 | ||||
-rwxr-xr-x | platform/ios/scripts/package.sh | 8 | ||||
-rw-r--r-- | platform/ios/toolchain.cmake | 136 |
9 files changed, 231 insertions, 240 deletions
diff --git a/platform/ios/WorkspaceSettings.xcsettings b/platform/ios/WorkspaceSettings.xcsettings index a2d959210c..20a7accf01 100644 --- a/platform/ios/WorkspaceSettings.xcsettings +++ b/platform/ios/WorkspaceSettings.xcsettings @@ -3,11 +3,15 @@ <plist version="1.0"> <dict> <key>BuildLocationStyle</key> - <string>UseAppPreferences</string> + <string>CustomLocation</string> + <key>CustomBuildIntermediatesPath</key> + <string>../../build/ios</string> <key>CustomBuildLocationType</key> - <string>RelativeToDerivedData</string> + <string>RelativeToWorkspace</string> + <key>CustomBuildProductsPath</key> + <string>../../build/ios</string> <key>DerivedDataCustomLocation</key> - <string>../../build</string> + <string>../../build/ios</string> <key>DerivedDataLocationStyle</key> <string>WorkspaceRelativePath</string> <key>IssueFilterStyle</key> diff --git a/platform/ios/bitrise.yml b/platform/ios/bitrise.yml index 6e4771273f..f87a97b7d6 100644 --- a/platform/ios/bitrise.yml +++ b/platform/ios/bitrise.yml @@ -29,6 +29,7 @@ workflows: - content: |- #!/bin/bash set -eu -o pipefail + brew install cmake brew tap mapbox/homebrew-ios-sim-3 brew install mapbox/homebrew-ios-sim-3/ios-sim gem install xcpretty --no-rdoc --no-ri diff --git a/platform/ios/config.cmake b/platform/ios/config.cmake new file mode 100644 index 0000000000..28bef0cfeb --- /dev/null +++ b/platform/ios/config.cmake @@ -0,0 +1,60 @@ +macro(mbgl_platform_core) + set_xcode_property(mbgl-core IPHONEOS_DEPLOYMENT_TARGET "8.0") + set_xcode_property(mbgl-core ENABLE_BITCODE "YES") + set_xcode_property(mbgl-core BITCODE_GENERATION_MODE bitcode) + + target_sources(mbgl-core + # Loop + PRIVATE platform/darwin/src/async_task.cpp + PRIVATE platform/darwin/src/run_loop.cpp + PRIVATE platform/darwin/src/timer.cpp + + # File source + PRIVATE platform/darwin/src/http_file_source.mm + PRIVATE platform/default/asset_file_source.cpp + PRIVATE platform/default/default_file_source.cpp + PRIVATE platform/default/online_file_source.cpp + + # Offline + PRIVATE platform/default/mbgl/storage/offline.cpp + PRIVATE platform/default/mbgl/storage/offline_database.cpp + PRIVATE platform/default/mbgl/storage/offline_database.hpp + PRIVATE platform/default/mbgl/storage/offline_download.cpp + PRIVATE platform/default/mbgl/storage/offline_download.hpp + PRIVATE platform/default/sqlite3.cpp + PRIVATE platform/default/sqlite3.hpp + + # Misc + PRIVATE platform/darwin/src/log_nslog.mm + PRIVATE platform/darwin/src/nsthread.mm + PRIVATE platform/darwin/src/reachability.m + PRIVATE platform/darwin/src/string_nsstring.mm + + # Image handling + PRIVATE platform/darwin/src/image.mm + + # Headless view + PRIVATE platform/darwin/src/headless_view_eagl.mm + PRIVATE platform/default/headless_display.cpp + PRIVATE platform/default/headless_view.cpp + ) + + target_compile_options(mbgl-core + PRIVATE -fobjc-arc + ) + + # TODO: Remove this by converting to ARC + set_source_files_properties( + platform/darwin/src/headless_view_eagl.mm + PROPERTIES + COMPILE_FLAGS -fno-objc-arc + ) + + target_include_directories(mbgl-core + PRIVATE platform/default + ) + + target_link_libraries(mbgl-core + PUBLIC -lz + ) +endmacro()
\ No newline at end of file diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index bfd5a5e8a9..8fe54e7712 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -25,6 +25,7 @@ 40EDA1C21CFE0E0500D9EA68 /* MGLAnnotationContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 40EDA1BE1CFE0D4A00D9EA68 /* MGLAnnotationContainerView.m */; }; 40FDA76B1CCAAA6800442548 /* MBXAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 40FDA76A1CCAAA6800442548 /* MBXAnnotationView.m */; }; 554180421D2E97DE00012372 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 554180411D2E97DE00012372 /* OpenGLES.framework */; }; + 55D8C9961D0F18CE00F42F10 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 55D8C9951D0F18CE00F42F10 /* libsqlite3.tbd */; }; DA0CD5901CF56F6A00A5F5A5 /* MGLFeatureTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA0CD58F1CF56F6A00A5F5A5 /* MGLFeatureTests.mm */; }; DA17BE301CC4BAC300402C41 /* MGLMapView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = DA17BE2F1CC4BAC300402C41 /* MGLMapView_Internal.h */; }; DA17BE311CC4BDAA00402C41 /* MGLMapView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = DA17BE2F1CC4BAC300402C41 /* MGLMapView_Internal.h */; }; @@ -156,7 +157,6 @@ DA88488B1CBB037E00AB86E3 /* SMCalloutView.h in Headers */ = {isa = PBXBuildFile; fileRef = DA8848891CBB037E00AB86E3 /* SMCalloutView.h */; }; DA88488C1CBB037E00AB86E3 /* SMCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88488A1CBB037E00AB86E3 /* SMCalloutView.m */; }; DA88488E1CBB047F00AB86E3 /* reachability.h in Headers */ = {isa = PBXBuildFile; fileRef = DA88488D1CBB047F00AB86E3 /* reachability.h */; }; - DA8848901CBB048E00AB86E3 /* reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88488F1CBB048E00AB86E3 /* reachability.m */; }; DA8933A31CCC95B000E68420 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA89339F1CCC951200E68420 /* Localizable.strings */; }; DA8933BC1CCD2CA100E68420 /* Foundation.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA8933BA1CCD2CA100E68420 /* Foundation.strings */; }; DA8933BF1CCD2CAD00E68420 /* Foundation.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = DA8933BD1CCD2CAD00E68420 /* Foundation.stringsdict */; }; @@ -200,7 +200,6 @@ DAA4E4291CBB730400178DFB /* NSBundle+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848131CBAFA6200AB86E3 /* NSBundle+MGLAdditions.m */; }; DAA4E42A1CBB730400178DFB /* NSProcessInfo+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848161CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.m */; }; DAA4E42B1CBB730400178DFB /* NSString+MGLAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848181CBAFA6200AB86E3 /* NSString+MGLAdditions.m */; }; - DAA4E42C1CBB730400178DFB /* reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88488F1CBB048E00AB86E3 /* reachability.m */; }; DAA4E42D1CBB730400178DFB /* MGLAnnotationImage.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848411CBAFB9800AB86E3 /* MGLAnnotationImage.m */; }; DAA4E42E1CBB730400178DFB /* MGLAPIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848431CBAFB9800AB86E3 /* MGLAPIClient.m */; }; DAA4E42F1CBB730400178DFB /* MGLCompactCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848451CBAFB9800AB86E3 /* MGLCompactCalloutView.m */; }; @@ -211,7 +210,6 @@ DAA4E4341CBB730400178DFB /* MGLUserLocationAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88484E1CBAFB9800AB86E3 /* MGLUserLocationAnnotationView.m */; }; DAA4E4351CBB730400178DFB /* SMCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88488A1CBB037E00AB86E3 /* SMCalloutView.m */; }; DAABF73D1CBC59BB005B1825 /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAABF73B1CBC59BB005B1825 /* libmbgl-core.a */; }; - DAABF73E1CBC59BB005B1825 /* libmbgl-platform-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAABF73C1CBC59BB005B1825 /* libmbgl-platform-ios.a */; }; DABCABAC1CB80692000A7C39 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DABCABAB1CB80692000A7C39 /* main.m */; }; DABCABAF1CB80692000A7C39 /* MBXBenchAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DABCABAE1CB80692000A7C39 /* MBXBenchAppDelegate.m */; }; DABCABB21CB80692000A7C39 /* MBXBenchViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = DABCABB11CB80692000A7C39 /* MBXBenchViewController.mm */; }; @@ -349,6 +347,8 @@ 40FDA7691CCAAA6800442548 /* MBXAnnotationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBXAnnotationView.h; sourceTree = "<group>"; }; 40FDA76A1CCAAA6800442548 /* MBXAnnotationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBXAnnotationView.m; sourceTree = "<group>"; }; 554180411D2E97DE00012372 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + 55D8C9941D0F133500F42F10 /* config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = config.xcconfig; path = ../../build/ios/config.xcconfig; sourceTree = "<group>"; }; + 55D8C9951D0F18CE00F42F10 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; }; DA0CD58F1CF56F6A00A5F5A5 /* MGLFeatureTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLFeatureTests.mm; path = ../../darwin/test/MGLFeatureTests.mm; sourceTree = "<group>"; }; DA17BE2F1CC4BAC300402C41 /* MGLMapView_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLMapView_Internal.h; sourceTree = "<group>"; }; DA1DC94A1CB6C1C2006E619F /* Mapbox GL.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Mapbox GL.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -495,7 +495,6 @@ DAA4E4061CBB5CBF00178DFB /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; DAA4E4131CBB71D400178DFB /* libMapbox.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMapbox.a; sourceTree = BUILT_PRODUCTS_DIR; }; DAABF73B1CBC59BB005B1825 /* libmbgl-core.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libmbgl-core.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - DAABF73C1CBC59BB005B1825 /* libmbgl-platform-ios.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libmbgl-platform-ios.a"; sourceTree = BUILT_PRODUCTS_DIR; }; DABCABA81CB80692000A7C39 /* Bench GL.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Bench GL.app"; sourceTree = BUILT_PRODUCTS_DIR; }; DABCABAB1CB80692000A7C39 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; DABCABAD1CB80692000A7C39 /* MBXBenchAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBXBenchAppDelegate.h; sourceTree = "<group>"; }; @@ -507,7 +506,6 @@ DABCABBB1CB80692000A7C39 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; DABCABBF1CB80717000A7C39 /* locations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = locations.cpp; sourceTree = "<group>"; }; DABCABC01CB80717000A7C39 /* locations.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = locations.hpp; sourceTree = "<group>"; }; - DAC07C961CBB2CD6000CB309 /* mbgl.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = mbgl.xcconfig; path = ../../build/ios/mbgl.xcconfig; sourceTree = "<group>"; }; DAC49C621CD07D74009E1AA3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = "<group>"; }; DAD165691CF41981001FF4B9 /* MGLFeature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFeature.h; sourceTree = "<group>"; }; DAD1656A1CF41981001FF4B9 /* MGLFeature_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLFeature_Private.h; sourceTree = "<group>"; }; @@ -539,7 +537,7 @@ buildActionMask = 2147483647; files = ( DAABF73D1CBC59BB005B1825 /* libmbgl-core.a in Frameworks */, - DAABF73E1CBC59BB005B1825 /* libmbgl-platform-ios.a in Frameworks */, + 55D8C9961D0F18CE00F42F10 /* libsqlite3.tbd in Frameworks */, DA27C24E1CBB3811000B0ECD /* GLKit.framework in Frameworks */, DAA4E4051CBB5C9E00178DFB /* ImageIO.framework in Frameworks */, DAA4E4071CBB5CBF00178DFB /* MobileCoreServices.framework in Frameworks */, @@ -643,8 +641,8 @@ 36F1153B1D46080700878E1A /* libmbgl-core.a */, 36F1153C1D46080700878E1A /* libmbgl-platform-ios.a */, 554180411D2E97DE00012372 /* OpenGLES.framework */, + 55D8C9951D0F18CE00F42F10 /* libsqlite3.tbd */, DAABF73B1CBC59BB005B1825 /* libmbgl-core.a */, - DAABF73C1CBC59BB005B1825 /* libmbgl-platform-ios.a */, DAA4E4021CBB5C2F00178DFB /* CoreGraphics.framework */, DA27C24D1CBB3811000B0ECD /* GLKit.framework */, DAA4E4041CBB5C9E00178DFB /* ImageIO.framework */, @@ -848,7 +846,7 @@ isa = PBXGroup; children = ( DA35A2D11CCAB25200E826B2 /* jazzy.yml */, - DAC07C961CBB2CD6000CB309 /* mbgl.xcconfig */, + 55D8C9941D0F133500F42F10 /* config.xcconfig */, ); name = Configuration; sourceTree = "<group>"; @@ -1399,7 +1397,6 @@ DA88488C1CBB037E00AB86E3 /* SMCalloutView.m in Sources */, DA35A2B81CCA9A5D00E826B2 /* MGLClockDirectionFormatter.m in Sources */, DAD1657A1CF4CDFF001FF4B9 /* MGLShapeCollection.m in Sources */, - DA8848901CBB048E00AB86E3 /* reachability.m in Sources */, DA8848211CBAFA6200AB86E3 /* MGLOfflinePack.mm in Sources */, DA8848591CBAFB9800AB86E3 /* MGLMapView.mm in Sources */, DA8848501CBAFB9800AB86E3 /* MGLAnnotationImage.m in Sources */, @@ -1457,7 +1454,6 @@ DAA4E41E1CBB730400178DFB /* MGLMapCamera.mm in Sources */, 4018B1C81CDC287F00F666AF /* MGLAnnotationView.mm in Sources */, DAA4E4341CBB730400178DFB /* MGLUserLocationAnnotationView.m in Sources */, - DAA4E42C1CBB730400178DFB /* reachability.m in Sources */, DAA4E4311CBB730400178DFB /* MGLMapboxEvents.m in Sources */, DAA4E4231CBB730400178DFB /* MGLPolygon.mm in Sources */, DAA4E42A1CBB730400178DFB /* NSProcessInfo+MGLAdditions.m in Sources */, @@ -1703,9 +1699,9 @@ }; DA2E885A1CC036F400F24E7B /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DAC07C961CBB2CD6000CB309 /* mbgl.xcconfig */; + baseConfigurationReference = 55D8C9941D0F133500F42F10 /* config.xcconfig */; buildSettings = { - HEADER_SEARCH_PATHS = ../../include; + HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; INFOPLIST_FILE = test/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -1722,9 +1718,9 @@ }; DA2E885B1CC036F400F24E7B /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DAC07C961CBB2CD6000CB309 /* mbgl.xcconfig */; + baseConfigurationReference = 55D8C9941D0F133500F42F10 /* config.xcconfig */; buildSettings = { - HEADER_SEARCH_PATHS = ../../include; + HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; INFOPLIST_FILE = test/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -1741,7 +1737,7 @@ }; DA8847DB1CBAF91600AB86E3 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DAC07C961CBB2CD6000CB309 /* mbgl.xcconfig */; + baseConfigurationReference = 55D8C9941D0F133500F42F10 /* config.xcconfig */; buildSettings = { BITCODE_GENERATION_MODE = bitcode; CURRENT_PROJECT_VERSION = 1; @@ -1749,11 +1745,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - HEADER_SEARCH_PATHS = ( - ../default, - ../../include, - ../../src, - ); + HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; INFOPLIST_FILE = framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -1767,12 +1759,7 @@ "$(geometry_cflags)", "$(geojson_cflags)", ); - OTHER_LDFLAGS = ( - "$(sqlite_ldflags)", - "$(zlib_ldflags)", - "$(opengl_ldflags)", - "$(geojson_static_libs)", - ); + OTHER_LDFLAGS = "$(mbgl_core_LINK_LIBRARIES)"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.sdk.ios; PRODUCT_NAME = Mapbox; SKIP_INSTALL = YES; @@ -1783,7 +1770,7 @@ }; DA8847DC1CBAF91600AB86E3 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DAC07C961CBB2CD6000CB309 /* mbgl.xcconfig */; + baseConfigurationReference = 55D8C9941D0F133500F42F10 /* config.xcconfig */; buildSettings = { BITCODE_GENERATION_MODE = bitcode; CURRENT_PROJECT_VERSION = 1; @@ -1791,11 +1778,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - HEADER_SEARCH_PATHS = ( - ../default, - ../../include, - ../../src, - ); + HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; INFOPLIST_FILE = framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -1809,12 +1792,7 @@ "$(geometry_cflags)", "$(geojson_cflags)", ); - OTHER_LDFLAGS = ( - "$(sqlite_ldflags)", - "$(zlib_ldflags)", - "$(opengl_ldflags)", - "$(geojson_static_libs)", - ); + OTHER_LDFLAGS = "$(mbgl_core_LINK_LIBRARIES)"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.sdk.ios; PRODUCT_NAME = Mapbox; SKIP_INSTALL = YES; @@ -1847,18 +1825,10 @@ }; DAA4E41A1CBB71D500178DFB /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DAC07C961CBB2CD6000CB309 /* mbgl.xcconfig */; + baseConfigurationReference = 55D8C9941D0F133500F42F10 /* config.xcconfig */; buildSettings = { BITCODE_GENERATION_MODE = bitcode; - HEADER_SEARCH_PATHS = ( - ../default, - ../../include, - ../../src, - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/build/Debug-iphoneos", - ); + HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", "$(sqlite_cflags)", @@ -1870,10 +1840,7 @@ ); OTHER_LDFLAGS = ( "-ObjC", - "$(sqlite_ldflags)", - "$(zlib_ldflags)", - "$(opengl_ldflags)", - "$(geojson_static_libs)", + "$(mbgl_core_LINK_LIBRARIES)", ); PRODUCT_NAME = Mapbox; PUBLIC_HEADERS_FOLDER_PATH = Headers; @@ -1883,18 +1850,10 @@ }; DAA4E41B1CBB71D500178DFB /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = DAC07C961CBB2CD6000CB309 /* mbgl.xcconfig */; + baseConfigurationReference = 55D8C9941D0F133500F42F10 /* config.xcconfig */; buildSettings = { BITCODE_GENERATION_MODE = bitcode; - HEADER_SEARCH_PATHS = ( - ../default, - ../../include, - ../../src, - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/build/Debug-iphoneos", - ); + HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", "$(sqlite_cflags)", @@ -1906,10 +1865,7 @@ ); OTHER_LDFLAGS = ( "-ObjC", - "$(sqlite_ldflags)", - "$(zlib_ldflags)", - "$(opengl_ldflags)", - "$(geojson_static_libs)", + "$(mbgl_core_LINK_LIBRARIES)", ); PRODUCT_NAME = Mapbox; PUBLIC_HEADERS_FOLDER_PATH = Headers; diff --git a/platform/ios/ios.xcworkspace/contents.xcworkspacedata b/platform/ios/ios.xcworkspace/contents.xcworkspacedata index 929ade2fee..08503d2be1 100644 --- a/platform/ios/ios.xcworkspace/contents.xcworkspacedata +++ b/platform/ios/ios.xcworkspace/contents.xcworkspacedata @@ -11,6 +11,6 @@ location = "group:uitest/KIF/KIF.xcodeproj"> </FileRef> <FileRef - location = "group:../../build/ios/platform/ios/platform.xcodeproj"> + location = "group:../../build/ios/mbgl.xcodeproj"> </FileRef> </Workspace> diff --git a/platform/ios/platform.gyp b/platform/ios/platform.gyp deleted file mode 100644 index 4cb26091d4..0000000000 --- a/platform/ios/platform.gyp +++ /dev/null @@ -1,149 +0,0 @@ -{ - 'variables': { - 'loop_lib': 'darwin', - 'headless_lib': 'eagl', - 'coverage': 0, - }, - 'includes': [ - '../../build/ios/config.gypi', - '../../mbgl.gypi', - '../../test/test.gypi', - ], - 'target_defaults': { - 'target_conditions': [ - ['_type == "static_library"', { - 'xcode_settings': { - 'SDKROOT': 'iphoneos', - 'SUPPORTED_PLATFORMS': 'iphonesimulator iphoneos', - 'IPHONEOS_DEPLOYMENT_TARGET': '7.0', - 'TARGETED_DEVICE_FAMILY': '1,2', - 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', - 'CODE_SIGN_IDENTITY': 'iPhone Developer', - }, - }], - ], - }, - 'targets': [ - { - 'target_name': 'test', - 'type': 'executable', - 'product_name': 'ios-test', - 'product_extension': 'app', - 'mac_bundle': 1, - - 'dependencies': [ - 'test-lib', - 'platform-lib', - ], - - 'sources': [ - '../../test/src/main.mm', -# '../../src/mbgl/util/premultiply.cpp', - ], - - 'xcode_settings': { - 'SDKROOT': 'iphoneos', - 'SUPPORTED_PLATFORMS': 'iphonesimulator iphoneos', - 'INFOPLIST_FILE': '../../test/src/app-info.plist', - 'IPHONEOS_DEPLOYMENT_TARGET': '8.0', - 'TARGETED_DEVICE_FAMILY': '1,2', - 'COPY_PHASE_STRIP': 'NO', - 'CLANG_ENABLE_OBJC_ARC': 'YES', - 'CLANG_ENABLE_MODULES': 'YES', - 'CODE_SIGN_IDENTITY': 'iPhone Developer', - 'PRODUCT_BUNDLE_IDENTIFIER': 'com.mapbox.MapboxGLUnitTest', - }, - - 'copies': [{ - 'destination': '<(PRODUCT_DIR)/$(WRAPPER_NAME)/test', - 'files': [ '../../test/fixtures' ], - }], - - 'link_settings': { - 'libraries': [ - '$(SDKROOT)/System/Library/Frameworks/CoreGraphics.framework', - '$(SDKROOT)/System/Library/Frameworks/GLKit.framework', - '$(SDKROOT)/System/Library/Frameworks/ImageIO.framework', - '$(SDKROOT)/System/Library/Frameworks/MobileCoreServices.framework', - '$(SDKROOT)/System/Library/Frameworks/OpenGLES.framework', - ], - }, - }, - { - 'target_name': 'platform-lib', - 'product_name': 'mbgl-platform-ios', - 'type': 'static_library', - 'standalone_static_library': 1, - 'hard_dependency': 1, - 'dependencies': [ - 'core', - ], - - 'include_dirs': [ - 'include', - '../darwin/include', - '../default', - '../../include', - '../../src', # TODO: eliminate - '<(SHARED_INTERMEDIATE_DIR)/include', - ], - - 'sources': [ - '../default/asset_file_source.cpp', - '../default/default_file_source.cpp', - '../default/online_file_source.cpp', - '../default/mbgl/storage/offline.hpp', - '../default/mbgl/storage/offline.cpp', - '../default/mbgl/storage/offline_database.hpp', - '../default/mbgl/storage/offline_database.cpp', - '../default/mbgl/storage/offline_download.hpp', - '../default/mbgl/storage/offline_download.cpp', - '../default/sqlite3.hpp', - '../default/sqlite3.cpp', - '../darwin/src/http_file_source.mm', - '../darwin/src/log_nslog.mm', - '../darwin/src/string_nsstring.mm', - '../darwin/src/image.mm', - '../darwin/src/nsthread.mm', - '../darwin/src/reachability.m', - ], - - 'variables': { - 'cflags_cc': [ - '<@(sqlite_cflags)', - '<@(zlib_cflags)', - '<@(rapidjson_cflags)', - ], - 'ldflags': [ - '<@(sqlite_ldflags)', - '<@(zlib_ldflags)', - ], - 'libraries': [ - '<@(sqlite_static_libs)', - '<@(zlib_static_libs)', - ], - }, - - 'xcode_settings': { - 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], - 'CLANG_ENABLE_OBJC_ARC': 'YES', - 'CLANG_ENABLE_MODULES': 'YES', - }, - - 'conditions': [ - ['OS == "mac"', { - 'xcode_settings': { - 'BITCODE_GENERATION_MODE': 'bitcode', - }, - },], - ], - - 'link_settings': { - 'libraries': [ '<@(libraries)' ], - 'xcode_settings': { - 'OTHER_LDFLAGS': [ '<@(ldflags)' ], - }, - }, - }, - ], -} diff --git a/platform/ios/scripts/configure.sh b/platform/ios/scripts/configure.sh deleted file mode 100644 index 82599f0fe9..0000000000 --- a/platform/ios/scripts/configure.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -UNIQUE_RESOURCE_VERSION=dev -PROTOZERO_VERSION=1.3.0 -BOOST_VERSION=1.60.0 -SQLITE_VERSION=system -ZLIB_VERSION=system -GEOMETRY_VERSION=0.8.0 -GEOJSON_VERSION=0.1.4 -GEOJSONVT_VERSION=6.1.2 -SUPERCLUSTER_VERSION=0.2.0 -KDBUSH_VERSION=0.1.1 -VARIANT_VERSION=1.1.0 -RAPIDJSON_VERSION=1.0.2 -GTEST_VERSION=1.7.0 -PIXELMATCH_VERSION=0.9.0 -EARCUT_VERSION=0.11 diff --git a/platform/ios/scripts/package.sh b/platform/ios/scripts/package.sh index c012934203..b431bd689d 100755 --- a/platform/ios/scripts/package.sh +++ b/platform/ios/scripts/package.sh @@ -5,9 +5,9 @@ set -o pipefail set -u NAME=Mapbox -OUTPUT=build/ios/pkg +OUTPUT=platform/ios/pkg DERIVED_DATA=build/ios -PRODUCTS=${DERIVED_DATA}/Build/Products +PRODUCTS=${DERIVED_DATA} BUILDTYPE=${BUILDTYPE:-Debug} BUILD_FOR_DEVICE=${BUILD_DEVICE:-true} @@ -150,7 +150,7 @@ if [[ "${BUILD_FOR_DEVICE}" == true ]]; then ${PRODUCTS}/${BUILDTYPE}-iphonesimulator/${NAME}.framework/${NAME} \ -create -output ${OUTPUT}/dynamic/${NAME}.framework/${NAME} | echo fi - + cp -rv ${PRODUCTS}/${BUILDTYPE}-iphoneos/Settings.bundle ${STATIC_SETTINGS_DIR} else if [[ ${BUILD_STATIC} == true ]]; then @@ -175,7 +175,7 @@ else ${OUTPUT}/dynamic/ fi fi - + cp -rv ${PRODUCTS}/${BUILDTYPE}-iphonesimulator/Settings.bundle ${STATIC_SETTINGS_DIR} fi diff --git a/platform/ios/toolchain.cmake b/platform/ios/toolchain.cmake new file mode 100644 index 0000000000..60dbac07c7 --- /dev/null +++ b/platform/ios/toolchain.cmake @@ -0,0 +1,136 @@ +# From https://github.com/OtherLevels/ios-cmake +# This file is based off of the Platform/Darwin.cmake and Platform/UnixPaths.cmake +# files which are included with CMake 2.8.4 +# It has been altered for iOS development + +# Options: +# +# IOS_PLATFORM = OS (default) or SIMULATOR or SIMULATOR64 +# This decides if SDKS will be selected from the iPhoneOS.platform or iPhoneSimulator.platform folders +# OS - the default, used to build for iPhone and iPad physical devices, which have an arm arch. +# SIMULATOR - used to build for the Simulator platforms, which have an x86 arch. +# +# CMAKE_IOS_DEVELOPER_ROOT = automatic(default) or /path/to/platform/Developer folder +# By default this location is automatcially chosen based on the IOS_PLATFORM value above. +# If set manually, it will override the default location and force the user of a particular Developer Platform +# +# CMAKE_IOS_SDK_ROOT = automatic(default) or /path/to/platform/Developer/SDKs/SDK folder +# By default this location is automatcially chosen based on the CMAKE_IOS_DEVELOPER_ROOT value. +# In this case it will always be the most up-to-date SDK found in the CMAKE_IOS_DEVELOPER_ROOT path. +# If set manually, this will force the use of a specific SDK version + +# Macros: +# +# set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE) +# A convenience macro for setting xcode specific properties on targets +# example: set_xcode_property (myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1") +# +# find_host_package (PROGRAM ARGS) +# A macro used to find executable programs on the host system, not within the iOS environment. +# Thanks to the android-cmake project for providing the command + +# Standard settings +set (CMAKE_SYSTEM_NAME Darwin) +set (CMAKE_SYSTEM_VERSION 1) +set (UNIX True) +set (APPLE True) +set (IOS True) + +# Required as of cmake 2.8.10 +set (CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING "Force unset of the deployment target for iOS" FORCE) + +# Determine the cmake host system version so we know where to find the iOS SDKs +find_program (CMAKE_UNAME uname /bin /usr/bin /usr/local/bin) +if (CMAKE_UNAME) + exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION) + string (REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_HOST_SYSTEM_VERSION}") +endif (CMAKE_UNAME) + +# Force the compilers to gcc for iOS +include (CMakeForceCompiler) +set(XCODE_TOOLCHAIN /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain) +set(XCODE_BIN ${XCODE_TOOLCHAIN}/usr/bin) +set(CMAKE_C_COMPILER ${XCODE_BIN}/clang) +set(CMAKE_CXX_COMPILER ${XCODE_BIN}/clang++) +set(CMAKE_FIND_ROOT_PATH ${XCODE_TOOLCHAIN_ROOT}) +set(CMAKE_AR ar CACHE FILEPATH "" FORCE) + +# Skip the platform compiler checks for cross compiling +set (CMAKE_CXX_COMPILER_WORKS TRUE) +set (CMAKE_C_COMPILER_WORKS TRUE) + +# All iOS/Darwin specific settings - some may be redundant +set (CMAKE_SHARED_LIBRARY_PREFIX "lib") +set (CMAKE_SHARED_LIBRARY_SUFFIX ".dylib") +set (CMAKE_SHARED_MODULE_PREFIX "lib") +set (CMAKE_SHARED_MODULE_SUFFIX ".so") +set (CMAKE_MODULE_EXISTS 1) +set (CMAKE_DL_LIBS "") + +set (CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ") +set (CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ") +set (CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}") +set (CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}") + + +# This was required for Other C++ Flags to be set for enabling bitcode in a static lib. +# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fembed-bitcode") + + +set (CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}") +set (CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}") + +set (CMAKE_PLATFORM_HAS_INSTALLNAME 1) +set (CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -headerpad_max_install_names") +set (CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -headerpad_max_install_names") +set (CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,") +set (CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,") +set (CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a") + + +# Point to the latest SDK. +set (CMAKE_OSX_SYSROOT "iphoneos" CACHE string "Sysroot used for iOS support") + + + +set (CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)" CACHE string "Build architecture for iOS") + +# Set the find root to the iOS developer roots and to user defined paths +set (CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} CACHE string "iOS find search path root") + +# default to searching for frameworks first +set (CMAKE_FIND_FRAMEWORK FIRST) + +# set up the default search directories for frameworks +set (CMAKE_SYSTEM_FRAMEWORK_PATH + ${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks + ${CMAKE_IOS_SDK_ROOT}/System/Library/PrivateFrameworks + ${CMAKE_IOS_SDK_ROOT}/Developer/Library/Frameworks +) + +# only search the iOS sdks, not the remainder of the host filesystem +set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) +set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + + +# This little macro lets you set any XCode specific property +macro (set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE) + set_property (TARGET ${TARGET} PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY} ${XCODE_VALUE}) +endmacro (set_xcode_property) + + +# This macro lets you find executable programs on the host system +macro (find_host_package) + set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) + set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + set (IOS FALSE) + + find_package(${ARGN}) + + set (IOS TRUE) + set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) + set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endmacro (find_host_package) |