forked from maplibre/maplibre-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
94 lines (87 loc) · 2.03 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
load("//bazel:flags.bzl", "CPP_FLAGS", "MAPLIBRE_FLAGS")
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
# This is defined by both
# platform/default/filesource-files.json
# and
# src/core-files.json
# because they have dependencies on each other
cc_library(
name = "mbgl-core",
srcs = glob(
[
"src/**/*.cpp",
"src/**/*.hpp",
],
allow_empty = False,
),
hdrs = glob(
[
"include/**/*.hpp",
],
allow_empty = False,
),
copts = CPP_FLAGS + MAPLIBRE_FLAGS,
includes = [
"include",
"src",
],
local_defines = [
r"MLN_VERSION_REV=\"standalone\"",
],
visibility = ["//visibility:public"],
deps = [
"//vendor:boost",
"//vendor:csscolorparser",
"//vendor:earcut.hpp",
"//vendor:eternal",
"//vendor:mapbox-base",
"//vendor:parsedate",
"//vendor:polylabel",
"//vendor:protozero",
"//vendor:unique_resource",
"//vendor:vector-tile",
"//vendor:wagyu",
] + select({
"//:ios": [
"//vendor:icu",
],
"//:linux": [],
}),
)
genrule(
name = "git_hash",
outs = ["hash"],
cmd = """
git rev-parse HEAD > $@
""",
local = True,
visibility = ["//visibility:public"],
)
# The next three rules are a bit of a hack
# they are needed until rules_apple has platforms support
# https://github.com/bazelbuild/rules_apple/issues/1658
# Allows passing a command line flag to set the Platform
# bazel build [target] --//:maplibre_platform=ios
string_flag(
name = "maplibre_platform",
build_setting_default = "ios",
)
config_setting(
name = "linux",
flag_values = {
":maplibre_platform": "linux",
},
)
config_setting(
name = "ios",
flag_values = {
":maplibre_platform": "ios",
},
)
exports_files(
[
"LICENSE.md",
"scripts/style-spec-reference/v8.json",
],
visibility = ["//visibility:public"],
)