Add Bazel build file implementation (#419)
This commit is contained in:
85
platform/darwin/BUILD.bazel
Normal file
85
platform/darwin/BUILD.bazel
Normal file
@@ -0,0 +1,85 @@
|
||||
load("//bazel:flags.bzl", "CPP_FLAGS", "MAPLIBRE_FLAGS", "WARNING_FLAGS")
|
||||
|
||||
# Objc files for the iOS source
|
||||
objc_library(
|
||||
name = "darwin-objc",
|
||||
srcs = [
|
||||
"src/native_apple_interface.m",
|
||||
],
|
||||
hdrs = [
|
||||
"include/mbgl/interface/native_apple_interface.h",
|
||||
"include/mbgl/storage/reachability.h",
|
||||
"include/mbgl/util/image+MGLAdditions.hpp",
|
||||
],
|
||||
copts = WARNING_FLAGS + MAPLIBRE_FLAGS + [
|
||||
"-fmodules",
|
||||
],
|
||||
includes = [
|
||||
"include",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//:mbgl-core",
|
||||
"//platform/default:mbgl-default",
|
||||
],
|
||||
)
|
||||
|
||||
# Objcpp files for the iOS source
|
||||
objc_library(
|
||||
name = "darwin-objcpp",
|
||||
srcs = [
|
||||
"src/CFHandle.hpp",
|
||||
"src/collator.mm",
|
||||
"src/headless_backend_eagl.mm",
|
||||
"src/http_file_source.mm",
|
||||
"src/image.mm",
|
||||
"src/local_glyph_rasterizer.mm",
|
||||
"src/logging_nslog.mm",
|
||||
"src/nsthread.mm",
|
||||
"src/number_format.mm",
|
||||
"src/string_nsstring.mm",
|
||||
],
|
||||
hdrs = [
|
||||
"include/mbgl/interface/native_apple_interface.h",
|
||||
"include/mbgl/storage/reachability.h",
|
||||
"include/mbgl/util/image+MGLAdditions.hpp",
|
||||
],
|
||||
copts = CPP_FLAGS + MAPLIBRE_FLAGS + [
|
||||
"-fcxx-modules",
|
||||
"-fmodules",
|
||||
"-Wno-vla-extension",
|
||||
"-Wno-gnu-conditional-omitted-operand",
|
||||
],
|
||||
includes = [
|
||||
"include",
|
||||
],
|
||||
sdk_frameworks = [
|
||||
"CoreText",
|
||||
"ImageIO",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//:mbgl-core",
|
||||
"//platform/default:mbgl-default",
|
||||
],
|
||||
)
|
||||
|
||||
# Loop files for iOS.
|
||||
objc_library(
|
||||
name = "darwin-loop",
|
||||
srcs = [
|
||||
"src/async_task.cpp",
|
||||
"src/gl_functions.cpp",
|
||||
"src/run_loop.cpp",
|
||||
"src/timer.cpp",
|
||||
],
|
||||
copts = CPP_FLAGS + MAPLIBRE_FLAGS,
|
||||
sdk_frameworks = [
|
||||
"OpenGLES",
|
||||
"SystemConfiguration",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//:mbgl-core",
|
||||
],
|
||||
)
|
||||
56
platform/default/BUILD.bazel
Normal file
56
platform/default/BUILD.bazel
Normal file
@@ -0,0 +1,56 @@
|
||||
load("//bazel:flags.bzl", "CPP_FLAGS", "MAPLIBRE_FLAGS")
|
||||
|
||||
# From: platform/ios/core-files.json
|
||||
# Mostly platform/default
|
||||
cc_library(
|
||||
name = "mbgl-default",
|
||||
srcs = [
|
||||
"src/mbgl/gfx/headless_backend.cpp",
|
||||
"src/mbgl/gfx/headless_frontend.cpp",
|
||||
"src/mbgl/gl/headless_backend.cpp",
|
||||
"src/mbgl/map/map_snapshotter.cpp",
|
||||
"src/mbgl/platform/time.cpp",
|
||||
"src/mbgl/storage/asset_file_source.cpp",
|
||||
"src/mbgl/storage/database_file_source.cpp",
|
||||
"src/mbgl/storage/file_source_manager.cpp",
|
||||
"src/mbgl/storage/file_source_request.cpp",
|
||||
"src/mbgl/storage/local_file_request.cpp",
|
||||
"src/mbgl/storage/local_file_source.cpp",
|
||||
"src/mbgl/storage/main_resource_loader.cpp",
|
||||
"src/mbgl/storage/mbtiles_file_source.cpp",
|
||||
"src/mbgl/storage/offline.cpp",
|
||||
"src/mbgl/storage/offline_database.cpp",
|
||||
"src/mbgl/storage/offline_download.cpp",
|
||||
"src/mbgl/storage/online_file_source.cpp",
|
||||
"src/mbgl/storage/sqlite3.cpp",
|
||||
"src/mbgl/text/bidi.cpp",
|
||||
"src/mbgl/util/compression.cpp",
|
||||
"src/mbgl/util/monotonic_timer.cpp",
|
||||
"src/mbgl/util/png_writer.cpp",
|
||||
"src/mbgl/util/thread_local.cpp",
|
||||
"src/mbgl/util/utf.cpp",
|
||||
],
|
||||
hdrs = [
|
||||
"include/mbgl/gfx/headless_backend.hpp",
|
||||
"include/mbgl/gfx/headless_frontend.hpp",
|
||||
"include/mbgl/gl/headless_backend.hpp",
|
||||
"include/mbgl/map/map_snapshotter.hpp",
|
||||
"include/mbgl/storage/file_source_request.hpp",
|
||||
"include/mbgl/storage/local_file_request.hpp",
|
||||
"include/mbgl/storage/merge_sideloaded.hpp",
|
||||
"include/mbgl/storage/offline_database.hpp",
|
||||
"include/mbgl/storage/offline_download.hpp",
|
||||
"include/mbgl/storage/offline_schema.hpp",
|
||||
"include/mbgl/storage/sqlite3.hpp",
|
||||
"include/mbgl/text/unaccent.hpp",
|
||||
],
|
||||
copts = CPP_FLAGS + MAPLIBRE_FLAGS,
|
||||
includes = [
|
||||
"include",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//:mbgl-core",
|
||||
"//platform/darwin:darwin-loop",
|
||||
],
|
||||
)
|
||||
334
platform/ios/BUILD.bazel
Normal file
334
platform/ios/BUILD.bazel
Normal file
@@ -0,0 +1,334 @@
|
||||
load("@build_bazel_rules_apple//apple:apple.bzl", "apple_static_xcframework", "apple_xcframework")
|
||||
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_framework")
|
||||
load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_bundle")
|
||||
load("//bazel:flags.bzl", "CPP_FLAGS", "MAPLIBRE_FLAGS", "WARNING_FLAGS")
|
||||
|
||||
# This list of public headers is from what Mapbox vendors with their dynamic framework
|
||||
# If we forget one the build will fail, and if we add too many there will be a warning
|
||||
# (which also causes a build failure) so we don't need to worry too much about getting
|
||||
# this wrong
|
||||
# A combination of Mapbox.h and all its headers' imports as recursively
|
||||
_PUBLIC_HEADERS = [
|
||||
"platform/darwin/src/MGLAnnotation.h",
|
||||
"platform/darwin/src/MGLAttributedExpression.h",
|
||||
"platform/darwin/src/MGLAttributionInfo.h",
|
||||
"platform/darwin/src/MGLBackgroundStyleLayer.h",
|
||||
"platform/darwin/src/MGLCircleStyleLayer.h",
|
||||
"platform/darwin/src/MGLClockDirectionFormatter.h",
|
||||
"platform/darwin/src/MGLCluster.h",
|
||||
"platform/darwin/src/MGLCompassDirectionFormatter.h",
|
||||
"platform/darwin/src/MGLComputedShapeSource.h",
|
||||
"platform/darwin/src/MGLCoordinateFormatter.h",
|
||||
"platform/darwin/src/MGLDefaultStyle.h",
|
||||
"platform/darwin/src/MGLDistanceFormatter.h",
|
||||
"platform/darwin/src/MGLFeature.h",
|
||||
"platform/darwin/src/MGLFillExtrusionStyleLayer.h",
|
||||
"platform/darwin/src/MGLFillStyleLayer.h",
|
||||
"platform/darwin/src/MGLForegroundStyleLayer.h",
|
||||
"platform/darwin/src/MGLFoundation.h",
|
||||
"platform/darwin/src/MGLGeometry.h",
|
||||
"platform/darwin/src/MGLHeatmapStyleLayer.h",
|
||||
"platform/darwin/src/MGLHillshadeStyleLayer.h",
|
||||
"platform/darwin/src/MGLImageSource.h",
|
||||
"platform/darwin/src/MGLLight.h",
|
||||
"platform/darwin/src/MGLLineStyleLayer.h",
|
||||
"platform/darwin/src/MGLLocationManager.h",
|
||||
"platform/darwin/src/MGLLoggingConfiguration.h",
|
||||
"platform/darwin/src/MGLMapCamera.h",
|
||||
"platform/darwin/src/MGLMapSnapshotter.h",
|
||||
"platform/darwin/src/MGLMultiPoint.h",
|
||||
"platform/darwin/src/MGLNetworkConfiguration.h",
|
||||
"platform/darwin/src/MGLOfflinePack.h",
|
||||
"platform/darwin/src/MGLOfflineRegion.h",
|
||||
"platform/darwin/src/MGLOfflineStorage.h",
|
||||
"platform/darwin/src/MGLOpenGLStyleLayer.h",
|
||||
"platform/darwin/src/MGLOverlay.h",
|
||||
"platform/darwin/src/MGLPointAnnotation.h",
|
||||
"platform/darwin/src/MGLPointCollection.h",
|
||||
"platform/darwin/src/MGLPolygon.h",
|
||||
"platform/darwin/src/MGLPolyline.h",
|
||||
"platform/darwin/src/MGLRasterDEMSource.h",
|
||||
"platform/darwin/src/MGLRasterStyleLayer.h",
|
||||
"platform/darwin/src/MGLRasterTileSource.h",
|
||||
"platform/darwin/src/MGLSettings.h",
|
||||
"platform/darwin/src/MGLShape.h",
|
||||
"platform/darwin/src/MGLShapeCollection.h",
|
||||
"platform/darwin/src/MGLShapeOfflineRegion.h",
|
||||
"platform/darwin/src/MGLShapeSource.h",
|
||||
"platform/darwin/src/MGLSource.h",
|
||||
"platform/darwin/src/MGLStyle.h",
|
||||
"platform/darwin/src/MGLStyleLayer.h",
|
||||
"platform/darwin/src/MGLStyleValue.h",
|
||||
"platform/darwin/src/MGLSymbolStyleLayer.h",
|
||||
"platform/darwin/src/MGLTilePyramidOfflineRegion.h",
|
||||
"platform/darwin/src/MGLTileServerOptions.h",
|
||||
"platform/darwin/src/MGLTileSource.h",
|
||||
"platform/darwin/src/MGLTypes.h",
|
||||
"platform/darwin/src/MGLVectorStyleLayer.h",
|
||||
"platform/darwin/src/MGLVectorTileSource.h",
|
||||
"platform/darwin/src/NSExpression+MGLAdditions.h",
|
||||
"platform/darwin/src/NSPredicate+MGLAdditions.h",
|
||||
"platform/darwin/src/NSValue+MGLAdditions.h",
|
||||
"platform/ios/src/MGLAnnotationImage.h",
|
||||
"platform/ios/src/MGLAnnotationView.h",
|
||||
"platform/ios/src/MGLCalloutView.h",
|
||||
"platform/ios/src/MGLCameraChangeReason.h",
|
||||
"platform/ios/src/MGLCompassButton.h",
|
||||
"platform/ios/src/MGLMapProjection.h",
|
||||
"platform/ios/src/MGLMapView+IBAdditions.h",
|
||||
"platform/ios/src/MGLMapView.h",
|
||||
"platform/ios/src/MGLMapViewDelegate.h",
|
||||
"platform/ios/src/MGLUserLocation.h",
|
||||
"platform/ios/src/MGLUserLocationAnnotationView.h",
|
||||
"platform/ios/src/MGLUserLocationAnnotationViewStyle.h",
|
||||
]
|
||||
|
||||
apple_static_xcframework(
|
||||
name = "Mapbox.static",
|
||||
bundle_name = "Mapbox",
|
||||
ios = {
|
||||
"simulator": [
|
||||
"x86_64",
|
||||
"arm64",
|
||||
],
|
||||
"device": ["arm64"],
|
||||
},
|
||||
minimum_os_versions = {"ios": "9.0"},
|
||||
public_hdrs = _PUBLIC_HEADERS,
|
||||
umbrella_header = "platform/ios/src/Mapbox.h",
|
||||
deps = ["sdk"],
|
||||
)
|
||||
|
||||
apple_xcframework(
|
||||
name = "Mapbox.dynamic",
|
||||
bundle_name = "Mapbox",
|
||||
infoplists = ["build/Info.plist"],
|
||||
ios = {
|
||||
"simulator": [
|
||||
"x86_64",
|
||||
"arm64",
|
||||
],
|
||||
"device": ["arm64"],
|
||||
},
|
||||
minimum_os_versions = {"ios": "9.0"},
|
||||
public_hdrs = _PUBLIC_HEADERS,
|
||||
umbrella_header = "platform/ios/src/Mapbox.h",
|
||||
deps = ["sdk"],
|
||||
)
|
||||
|
||||
# This target allows you to link the SDK to emulate linking it in the app
|
||||
# This should help us find issues with missing symbols sooner.
|
||||
ios_framework(
|
||||
name = "Mapbox.link",
|
||||
bundle_id = "com.maplibre.link",
|
||||
families = ["iphone"],
|
||||
infoplists = ["build/Info.plist"],
|
||||
linkopts = ["-all_load"],
|
||||
minimum_os_version = "9.0",
|
||||
deps = ["sdk"],
|
||||
)
|
||||
|
||||
objc_library(
|
||||
name = "sdk",
|
||||
data = ["resources"],
|
||||
sdk_dylibs = [
|
||||
"libz",
|
||||
"libsqlite3",
|
||||
"libc++",
|
||||
],
|
||||
sdk_frameworks = [
|
||||
"MobileCoreServices",
|
||||
"Security",
|
||||
"WebKit",
|
||||
],
|
||||
deps = [
|
||||
"objc-sdk",
|
||||
"objcpp-sdk",
|
||||
],
|
||||
)
|
||||
|
||||
apple_resource_bundle(
|
||||
name = "resources",
|
||||
bundle_id = "com.maplibre.mapbox",
|
||||
bundle_name = "Mapbox",
|
||||
infoplists = ["build/Info-static.plist"],
|
||||
resources = glob([
|
||||
"platform/ios/resources/*.lproj/**",
|
||||
"platform/ios/resources/*.xcassets/**",
|
||||
]),
|
||||
)
|
||||
|
||||
# Objcpp files for the iOS source
|
||||
objc_library(
|
||||
name = "objcpp-sdk",
|
||||
srcs = [
|
||||
"platform/darwin/src/MGLAttributionInfo.mm",
|
||||
"platform/darwin/src/MGLBackgroundStyleLayer.mm",
|
||||
"platform/darwin/src/MGLCircleStyleLayer.mm",
|
||||
"platform/darwin/src/MGLComputedShapeSource.mm",
|
||||
"platform/darwin/src/MGLDefaultStyle.mm",
|
||||
"platform/darwin/src/MGLFeature.mm",
|
||||
"platform/darwin/src/MGLFillExtrusionStyleLayer.mm",
|
||||
"platform/darwin/src/MGLFillStyleLayer.mm",
|
||||
"platform/darwin/src/MGLForegroundStyleLayer.mm",
|
||||
"platform/darwin/src/MGLFoundation.mm",
|
||||
"platform/darwin/src/MGLGeometry.mm",
|
||||
"platform/darwin/src/MGLHeatmapStyleLayer.mm",
|
||||
"platform/darwin/src/MGLHillshadeStyleLayer.mm",
|
||||
"platform/darwin/src/MGLImageSource.mm",
|
||||
"platform/darwin/src/MGLLight.mm",
|
||||
"platform/darwin/src/MGLLineStyleLayer.mm",
|
||||
"platform/darwin/src/MGLLoggingConfiguration.mm",
|
||||
"platform/darwin/src/MGLMapCamera.mm",
|
||||
"platform/darwin/src/MGLMapSnapshotter.mm",
|
||||
"platform/darwin/src/MGLMultiPoint.mm",
|
||||
"platform/darwin/src/MGLNetworkConfiguration.mm",
|
||||
"platform/darwin/src/MGLOfflinePack.mm",
|
||||
"platform/darwin/src/MGLOfflineStorage.mm",
|
||||
"platform/darwin/src/MGLOpenGLStyleLayer.mm",
|
||||
"platform/darwin/src/MGLPointAnnotation.mm",
|
||||
"platform/darwin/src/MGLPointCollection.mm",
|
||||
"platform/darwin/src/MGLPolygon.mm",
|
||||
"platform/darwin/src/MGLPolyline.mm",
|
||||
"platform/darwin/src/MGLRasterDEMSource.mm",
|
||||
"platform/darwin/src/MGLRasterStyleLayer.mm",
|
||||
"platform/darwin/src/MGLRasterTileSource.mm",
|
||||
"platform/darwin/src/MGLSettings.mm",
|
||||
"platform/darwin/src/MGLShape.mm",
|
||||
"platform/darwin/src/MGLShapeCollection.mm",
|
||||
"platform/darwin/src/MGLShapeOfflineRegion.mm",
|
||||
"platform/darwin/src/MGLShapeSource.mm",
|
||||
"platform/darwin/src/MGLSource.mm",
|
||||
"platform/darwin/src/MGLStyle.mm",
|
||||
"platform/darwin/src/MGLStyleLayer.mm",
|
||||
"platform/darwin/src/MGLStyleLayerManager.mm",
|
||||
"platform/darwin/src/MGLStyleValue.mm",
|
||||
"platform/darwin/src/MGLSymbolStyleLayer.mm",
|
||||
"platform/darwin/src/MGLTilePyramidOfflineRegion.mm",
|
||||
"platform/darwin/src/MGLTileServerOptions.mm",
|
||||
"platform/darwin/src/MGLTileSource.mm",
|
||||
"platform/darwin/src/MGLVectorStyleLayer.mm",
|
||||
"platform/darwin/src/MGLVectorTileSource.mm",
|
||||
"platform/darwin/src/NSArray+MGLAdditions.mm",
|
||||
"platform/darwin/src/NSBundle+MGLAdditions.mm",
|
||||
"platform/darwin/src/NSCoder+MGLAdditions.mm",
|
||||
"platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm",
|
||||
"platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm",
|
||||
"platform/darwin/src/NSDate+MGLAdditions.mm",
|
||||
"platform/darwin/src/NSDictionary+MGLAdditions.mm",
|
||||
"platform/darwin/src/NSExpression+MGLAdditions.mm",
|
||||
"platform/darwin/src/NSPredicate+MGLAdditions.mm",
|
||||
"platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm",
|
||||
"platform/ios/src/MGLAnnotationView.mm",
|
||||
"platform/ios/src/MGLCompassButton.mm",
|
||||
"platform/ios/src/MGLFaux3DUserLocationAnnotationView.mm",
|
||||
"platform/ios/src/MGLMapAccessibilityElement.mm",
|
||||
"platform/ios/src/MGLMapProjection.mm",
|
||||
"platform/ios/src/MGLMapView.mm",
|
||||
"platform/ios/src/MGLMapView+Impl.mm",
|
||||
"platform/ios/src/MGLMapView+OpenGL.mm",
|
||||
"platform/ios/src/MGLScaleBar.mm",
|
||||
"platform/ios/src/UIColor+MGLAdditions.mm",
|
||||
"platform/ios/src/UIImage+MGLAdditions.mm",
|
||||
],
|
||||
copts = CPP_FLAGS + MAPLIBRE_FLAGS + [
|
||||
"-fcxx-modules",
|
||||
"-fmodules",
|
||||
"-Wno-c99-extensions",
|
||||
"-Wno-gnu-zero-variadic-macro-arguments",
|
||||
"-Wno-gnu-conditional-omitted-operand",
|
||||
"-Wno-gnu-statement-expression",
|
||||
],
|
||||
includes = [
|
||||
"platform/darwin/include",
|
||||
],
|
||||
sdk_frameworks = [
|
||||
"CoreImage",
|
||||
"CoreLocation",
|
||||
"GLKit",
|
||||
"OpenGLES",
|
||||
"QuartzCore",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"objc-headers",
|
||||
"//:mbgl-core",
|
||||
"//platform/darwin:darwin-objcpp",
|
||||
"//platform/default:mbgl-default",
|
||||
"//platform/ios/platform/ios/vendor:SMCalloutView",
|
||||
],
|
||||
)
|
||||
|
||||
# platform/ios/sdk-files.json
|
||||
# Objc files for the iOS source
|
||||
objc_library(
|
||||
name = "objc-sdk",
|
||||
srcs = [
|
||||
"platform/darwin/src/MGLAttributedExpression.m",
|
||||
"platform/darwin/src/MGLClockDirectionFormatter.m",
|
||||
"platform/darwin/src/MGLCompassDirectionFormatter.m",
|
||||
"platform/darwin/src/MGLCoordinateFormatter.m",
|
||||
"platform/darwin/src/MGLDistanceFormatter.m",
|
||||
"platform/darwin/src/MGLLocationManager.m",
|
||||
"platform/darwin/src/MGLReachability.m",
|
||||
"platform/darwin/src/MGLRendererConfiguration.m",
|
||||
"platform/darwin/src/MGLTypes.m",
|
||||
"platform/darwin/src/NSString+MGLAdditions.m",
|
||||
"platform/darwin/src/NSURL+MGLAdditions.m",
|
||||
"platform/darwin/src/NSValue+MGLAdditions.m",
|
||||
"platform/ios/src/MGLAnnotationContainerView.m",
|
||||
"platform/ios/src/MGLAnnotationImage.m",
|
||||
"platform/ios/src/MGLCompactCalloutView.m",
|
||||
"platform/ios/src/MGLUserLocation.m",
|
||||
"platform/ios/src/MGLUserLocationAnnotationView.m",
|
||||
"platform/ios/src/MGLUserLocationAnnotationViewStyle.m",
|
||||
"platform/ios/src/MGLUserLocationHeadingArrowLayer.m",
|
||||
"platform/ios/src/MGLUserLocationHeadingBeamLayer.m",
|
||||
"platform/ios/src/NSOrthography+MGLAdditions.m",
|
||||
"platform/ios/src/UIDevice+MGLAdditions.m",
|
||||
"platform/ios/src/UIView+MGLAdditions.m",
|
||||
"platform/ios/src/UIViewController+MGLAdditions.m",
|
||||
],
|
||||
hdrs = [
|
||||
"platform/darwin/include/mbgl/util/image+MGLAdditions.hpp",
|
||||
],
|
||||
copts = WARNING_FLAGS + MAPLIBRE_FLAGS + [
|
||||
"-fmodules",
|
||||
"-Wno-gnu-zero-variadic-macro-arguments",
|
||||
"-Wno-variadic-macros",
|
||||
"-Wno-gnu-conditional-omitted-operand",
|
||||
],
|
||||
includes = [
|
||||
"platform/darwin/include",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"objc-headers",
|
||||
"//:mbgl-core",
|
||||
"//platform/darwin:darwin-objc",
|
||||
"//platform/default:mbgl-default",
|
||||
"//platform/ios/platform/ios/vendor:SMCalloutView",
|
||||
],
|
||||
)
|
||||
|
||||
# Common headers between objc and objcpp libraries.
|
||||
objc_library(
|
||||
name = "objc-headers",
|
||||
srcs = glob([
|
||||
"platform/darwin/src/*.h",
|
||||
"platform/ios/src/*.h",
|
||||
]),
|
||||
includes = [
|
||||
"platform/darwin/src",
|
||||
"platform/ios/src",
|
||||
],
|
||||
sdk_frameworks = [
|
||||
"CoreGraphics",
|
||||
"CoreLocation",
|
||||
"QuartzCore",
|
||||
],
|
||||
deps = [
|
||||
"//platform/darwin:darwin-objc",
|
||||
"//platform/darwin:darwin-objcpp",
|
||||
],
|
||||
)
|
||||
91
platform/ios/platform/ios/scripts/bazel-package.sh
Executable file
91
platform/ios/platform/ios/scripts/bazel-package.sh
Executable file
@@ -0,0 +1,91 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# "static" or "dynamic"
|
||||
build_type="static"
|
||||
|
||||
# "release" or "debug"
|
||||
release_type="release"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--static)
|
||||
build_type="static"
|
||||
shift
|
||||
;;
|
||||
--dynamic)
|
||||
build_type="dynamic"
|
||||
shift
|
||||
;;
|
||||
--release)
|
||||
release_type="release"
|
||||
shift
|
||||
;;
|
||||
--debug)
|
||||
release_type="debug"
|
||||
shift
|
||||
;;
|
||||
--link)
|
||||
build_type="link"
|
||||
shift
|
||||
;;
|
||||
--help)
|
||||
echo "Build the maplibre xcframework using the bazel build files. You must install Baselisk to build using this method."
|
||||
echo "Usage: .bazel-package.sh --static|--dynamic --release|--debug"
|
||||
echo "Defaults to \"--static --release\""
|
||||
exit 1
|
||||
;;
|
||||
-*|--*)
|
||||
echo "Unknown option $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "------ Build type: $build_type Release type: $release_type ------"
|
||||
|
||||
target="Mapbox.$build_type"
|
||||
|
||||
compilation_mode="opt"
|
||||
if [ "$release_type" = "debug" ]; then
|
||||
compilation_mode="dbg"
|
||||
fi;
|
||||
|
||||
pushd ../../../../../
|
||||
|
||||
echo "------ Determining Maplibre version and hash ------"
|
||||
|
||||
sem_version=$(git describe --tags --match=ios-v*.*.* --abbrev=0 | sed 's/^ios-v//')
|
||||
hash=$(git log | head -1 | awk '{ print $2 }' | cut -c 1-10) && true
|
||||
|
||||
# Move and configure the info plists with the semantic version and hash.
|
||||
temp_info_static_plist="platform/ios/build/Info-static.plist"
|
||||
temp_info_plist="platform/ios/build/Info.plist"
|
||||
|
||||
if [ ! -d platform/ios/build ]; then
|
||||
mkdir platform/ios/build
|
||||
fi
|
||||
|
||||
cp platform/ios/platform/ios/framework/Info-static.plist "$temp_info_static_plist"
|
||||
cp platform/ios/platform/ios/framework/Info.plist "$temp_info_plist"
|
||||
|
||||
plutil -replace MGLSemanticVersionString -string "$sem_version" "$temp_info_static_plist"
|
||||
plutil -replace MGLCommitHash -string "$hash" "$temp_info_static_plist"
|
||||
plutil -replace MGLSemanticVersionString -string "$sem_version" "$temp_info_plist"
|
||||
plutil -replace MGLCommitHash -string "$hash" "$temp_info_plist"
|
||||
|
||||
echo "------ Building Maplibre version: $sem_version hash: $hash ------"
|
||||
|
||||
bazel build //platform/ios:"$target" --apple_platform_type=ios \
|
||||
--apple_generate_dsym \
|
||||
--compilation_mode="$compilation_mode" \
|
||||
--features=dead_strip \
|
||||
--objc_enable_binary_stripping \
|
||||
--copt=-Wall --copt=-Wextra --copt=-Wpedantic \
|
||||
--copt=-Werror
|
||||
|
||||
popd
|
||||
|
||||
echo "Done."
|
||||
echo "Package will be available in \"/bazel-bin/platform/ios/platform/ios/$target.xcframework.zip\""
|
||||
22
platform/ios/platform/ios/vendor/BUILD.bazel
vendored
Normal file
22
platform/ios/platform/ios/vendor/BUILD.bazel
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
load("//bazel:flags.bzl", "WARNING_FLAGS")
|
||||
|
||||
# SMCalloutView
|
||||
objc_library(
|
||||
name = "SMCalloutView",
|
||||
srcs = glob(
|
||||
[
|
||||
"SMCalloutView/*.h",
|
||||
"SMCalloutView/*.m",
|
||||
],
|
||||
allow_empty = False,
|
||||
),
|
||||
hdrs = glob(
|
||||
[
|
||||
"SMCalloutView/*.h",
|
||||
],
|
||||
allow_empty = False,
|
||||
),
|
||||
copts = WARNING_FLAGS,
|
||||
includes = ["SMCalloutView"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
Reference in New Issue
Block a user