[buck] use buck to build library (#112)
This commit is contained in:
15
misc/buck/.buckconfig
Normal file
15
misc/buck/.buckconfig
Normal file
@@ -0,0 +1,15 @@
|
||||
[ndk]
|
||||
cpu_abis = armv7
|
||||
compiler = clang
|
||||
app_platform = android-14
|
||||
|
||||
[project]
|
||||
ignore = .git
|
||||
allow_symlinks = allow
|
||||
|
||||
[cxx]
|
||||
default_platform = iphonesimulator-x86_64
|
||||
|
||||
[apple]
|
||||
iphonesimulator_target_sdk_version = 9.0
|
||||
iphoneos_target_sdk_version = 9.0
|
||||
4
misc/buck/mapbox-gl-native/Android.mk
Normal file
4
misc/buck/mapbox-gl-native/Android.mk
Normal file
@@ -0,0 +1,4 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android-core
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
2
misc/buck/mapbox-gl-native/Application.mk
Normal file
2
misc/buck/mapbox-gl-native/Application.mk
Normal file
@@ -0,0 +1,2 @@
|
||||
APP_ABI := armeabi-v7a
|
||||
APP_PLATFORM := android-14
|
||||
140
misc/buck/mapbox-gl-native/BUCK
Normal file
140
misc/buck/mapbox-gl-native/BUCK
Normal file
@@ -0,0 +1,140 @@
|
||||
# BUILD FILE SYNTAX: SKYLARK
|
||||
|
||||
import json
|
||||
|
||||
mbgl_base_path = get_base_path() or '.'
|
||||
android_base_path = '../../'
|
||||
|
||||
def mbgl_load_file_lists(*argv):
|
||||
merged = dict(sources = [], public_headers = {}, private_headers = {})
|
||||
for arg in argv:
|
||||
filename = mbgl_base_path + '/' + arg + '-files.json'
|
||||
add_build_file_dep('//' + filename)
|
||||
files = json.load(open(filename))
|
||||
merged['public_headers'].update(files['public_headers'])
|
||||
merged['private_headers'].update(files['private_headers'])
|
||||
merged['sources'] += files['sources']
|
||||
return merged
|
||||
|
||||
def android_load_file_lists(*argv):
|
||||
merged = dict(sources = [], public_headers = {}, private_headers = {})
|
||||
for arg in argv:
|
||||
filename = '../../' + arg + '-files.json'
|
||||
add_build_file_dep('//' + filename)
|
||||
files = json.load(open(filename))
|
||||
merged['public_headers'].update(files['public_headers'])
|
||||
merged['private_headers'].update(files['private_headers'])
|
||||
merged['sources'] += files['sources']
|
||||
return merged
|
||||
|
||||
mbgl = dict(
|
||||
core = mbgl_load_file_lists('src/core', 'platform/default/filesource'),
|
||||
android = android_load_file_lists('core', 'filesource'),
|
||||
deps = [],
|
||||
)
|
||||
|
||||
def mbgl_vendor_library(name):
|
||||
files = mbgl_load_file_lists('vendor/' + name)
|
||||
cxx_library(
|
||||
name = "vendor-" + name,
|
||||
header_namespace = "",
|
||||
srcs = files['sources'],
|
||||
headers = files['private_headers'],
|
||||
exported_headers = files['public_headers'],
|
||||
link_style = 'static',
|
||||
compiler_flags = [
|
||||
"-Wno-tautological-unsigned-enum-zero-compare",
|
||||
],
|
||||
)
|
||||
mbgl['deps'].append(':vendor-' + name)
|
||||
|
||||
mbgl_vendor_library("icu")
|
||||
mbgl_vendor_library("boost")
|
||||
mbgl_vendor_library("cheap-ruler-cpp")
|
||||
mbgl_vendor_library("earcut.hpp")
|
||||
mbgl_vendor_library("eternal")
|
||||
mbgl_vendor_library("geojson-vt-cpp")
|
||||
mbgl_vendor_library("mapbox-base")
|
||||
mbgl_vendor_library("sqlite")
|
||||
mbgl_vendor_library("polylabel")
|
||||
mbgl_vendor_library("protozero")
|
||||
mbgl_vendor_library("shelf-pack-cpp")
|
||||
mbgl_vendor_library("unique_resource")
|
||||
mbgl_vendor_library("vector-tile")
|
||||
mbgl_vendor_library("wagyu")
|
||||
|
||||
cxx_library(
|
||||
name = "core",
|
||||
|
||||
srcs = mbgl['core']['sources'],
|
||||
platform_srcs = [
|
||||
("android", mbgl['android']['sources']),
|
||||
],
|
||||
|
||||
header_namespace = "",
|
||||
headers = mbgl['core']['private_headers'],
|
||||
exported_headers = mbgl['core']['public_headers'],
|
||||
platform_headers = [
|
||||
("android", mbgl['android']['private_headers'])
|
||||
],
|
||||
exported_platform_headers = [
|
||||
("android", mbgl['android']['public_headers']),
|
||||
],
|
||||
|
||||
compiler_flags = [
|
||||
"-std=c++14",
|
||||
"-g",
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
"-Werror",
|
||||
"-Wno-unused-variable",
|
||||
"-Wno-unused-parameter",
|
||||
"-Wno-c++11-narrowing",
|
||||
"-Wno-tautological-constant-compare",
|
||||
"-fexceptions",
|
||||
"-ftemplate-depth=1024",
|
||||
"-frtti",
|
||||
],
|
||||
|
||||
preprocessor_flags = [
|
||||
"-DMBGL_USE_GLES2=1",
|
||||
"-DMBGL_VERSION_REV=\"standalone\"",
|
||||
"-DRAPIDJSON_HAS_STDSTRING=1",
|
||||
],
|
||||
exported_platform_linker_flags = [
|
||||
("android", [
|
||||
"-lz",
|
||||
"-lEGL",
|
||||
"-lGLESv2",
|
||||
"-landroid",
|
||||
"-ljnigraphics",
|
||||
"-llog",
|
||||
"-fvisibility=hidden",
|
||||
"-Wl,--icf=safe",
|
||||
"-Wl,--version-script=" + android_base_path + "version-script"
|
||||
]),
|
||||
],
|
||||
|
||||
visibility = ["PUBLIC"],
|
||||
deps = mbgl['deps'],
|
||||
soname = "libmapbox-gl.$(ext)",
|
||||
)
|
||||
|
||||
ndk_library(
|
||||
name = "android-core",
|
||||
deps = [ ":core" ],
|
||||
flags = [
|
||||
"NDK_APPLICATION_MK=$(env PWD)/" + mbgl_base_path + "/Application.mk",
|
||||
],
|
||||
)
|
||||
|
||||
android_manifest(
|
||||
name = 'android-manifest',
|
||||
skeleton = 'sdk/src/main/AndroidManifest.xml',
|
||||
)
|
||||
|
||||
android_library(
|
||||
name = "android",
|
||||
deps = [ ":android-core" ],
|
||||
manifest = ":android-manifest",
|
||||
)
|
||||
1
misc/buck/mapbox-gl-native/include
Symbolic link
1
misc/buck/mapbox-gl-native/include
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../vendor/mapbox-gl-native/include
|
||||
1
misc/buck/mapbox-gl-native/mapbox-gl-native
Symbolic link
1
misc/buck/mapbox-gl-native/mapbox-gl-native
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../vendor/mapbox-gl-native
|
||||
1
misc/buck/mapbox-gl-native/platform
Symbolic link
1
misc/buck/mapbox-gl-native/platform
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../vendor/mapbox-gl-native/platform
|
||||
1
misc/buck/mapbox-gl-native/sdk
Symbolic link
1
misc/buck/mapbox-gl-native/sdk
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../MapboxGLAndroidSDK
|
||||
1
misc/buck/mapbox-gl-native/src
Symbolic link
1
misc/buck/mapbox-gl-native/src
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../vendor/mapbox-gl-native/src
|
||||
1
misc/buck/mapbox-gl-native/vendor
Symbolic link
1
misc/buck/mapbox-gl-native/vendor
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../vendor/mapbox-gl-native/vendor
|
||||
1
misc/buck/mapbox-gl-native/vendor-android
Symbolic link
1
misc/buck/mapbox-gl-native/vendor-android
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../vendor
|
||||
Reference in New Issue
Block a user