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"], )