Skip to content

Commit

Permalink
Selectable renderer implementation (maplibre#1247)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and louwers committed Aug 31, 2023
1 parent fe165c8 commit 1963697
Show file tree
Hide file tree
Showing 64 changed files with 1,189 additions and 316 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ node_modules
/bazel-*
CMakeLists.txt.user
CMakeFiles
__generated__
58 changes: 42 additions & 16 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
load("//bazel:flags.bzl", "CPP_FLAGS", "MAPLIBRE_FLAGS")
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load(
"//bazel:core.bzl",
"MLN_CORE_HEADERS",
"MLN_CORE_SOURCE",
"MLN_GENERATED_SHADER_HEADERS",
"MLN_GENERATED_STYLE_SOURCE",
"MLN_OPENGL_HEADERS",
"MLN_OPENGL_SOURCE",
"MLN_PRIVATE_GENERATED_STYLE_HEADERS",
"MLN_PUBLIC_GENERATED_STYLE_HEADERS",
load("//bazel:core.bzl", "MLN_CORE_SOURCE", "MLN_CORE_HEADERS", "MLN_OPENGL_SOURCE", "MLN_OPENGL_HEADERS", "MLN_DRAWABLES_SOURCE", "MLN_DRAWABLES_HEADERS")

string_flag(
name = "renderer",
build_setting_default = "drawable",
values=["legacy", "drawable", "split"]
)

config_setting(
name = "legacy_renderer",
flag_values = {
":renderer": "legacy"
}
)

config_setting(
name = "drawable_renderer",
flag_values = {
":renderer": "drawable"
}
)

config_setting(
name = "split_renderer",
flag_values = {
":renderer": "split"
}
)

# Generate code required by the core
Expand Down Expand Up @@ -76,15 +93,24 @@ cc_library(
# the prefix from the path.
cc_library(
name = "mbgl-core",
srcs = MLN_CORE_SOURCE +
MLN_GENERATED_STYLE_SOURCE +
MLN_OPENGL_SOURCE,
hdrs = MLN_CORE_HEADERS +
MLN_OPENGL_HEADERS,
srcs = MLN_CORE_SOURCE + select({
":drawable_renderer": MLN_DRAWABLES_SOURCE,
":split_renderer": MLN_DRAWABLES_SOURCE,
"//conditions:default": []
}) + MLN_OPENGL_SOURCE,
hdrs = MLN_CORE_HEADERS + select({
":drawable_renderer": MLN_DRAWABLES_HEADERS,
":split_renderer": MLN_DRAWABLES_HEADERS,
"//conditions:default": []
}) + MLN_OPENGL_HEADERS,
copts = CPP_FLAGS + MAPLIBRE_FLAGS,
defines = select({
":legacy_renderer": ["MLN_LEGACY_RENDERER=1", "MLN_DRAWABLE_RENDERER=0"],
":drawable_renderer": ["MLN_LEGACY_RENDERER=0", "MLN_DRAWABLE_RENDERER=1"],
":split_renderer": ["MLN_LEGACY_RENDERER=1", "MLN_DRAWABLE_RENDERER=1", "MLN_RENDERER_SPLIT_VIEW=1"],
}) + select({
"//:ios": ["GLES_SILENCE_DEPRECATION=1"],
"//conditions:default": [],
"//conditions:default": []
}),
includes = [
"include",
Expand Down
144 changes: 83 additions & 61 deletions CMakeLists.txt

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ http_archive(

http_archive(
name = "rules_xcodeproj",
sha256 = "5baccdd6a2734a0adeb9cb6175691d0609f8bdbd7c5f516e828d0df744ee9f6c",
url = "https://github.com/MobileNativeFoundation/rules_xcodeproj/releases/download/1.9.1/release.tar.gz",
sha256 = "f836d2a516a911dc0ace44b1f51aa575613f149a934f4be1e7bd551a549672ff",
url = "https://github.com/MobileNativeFoundation/rules_xcodeproj/releases/download/1.7.1/release.tar.gz",
)

load(
Expand Down Expand Up @@ -51,9 +51,9 @@ xcodeproj_rules_dependencies()

load(
"@build_bazel_rules_apple//apple:apple.bzl",
"provisioning_profile_repository",
"provisioning_profile_repository"
)

provisioning_profile_repository(
name = "local_provisioning_profiles",
)
name = "local_provisioning_profiles"
)
Loading

0 comments on commit 1963697

Please sign in to comment.