fix android builds

This commit is contained in:
Mautisim Munir 2022-11-15 23:15:11 +05:00
parent 1d5b6ff3fb
commit 903f536f9c
4 changed files with 22 additions and 8 deletions

View File

@ -728,7 +728,7 @@ cc_library(
cc_library(
name = "flow_limiter_calculator",
srcs = ["flow_limiter_calculator.h"],
srcs = ["flow_limiter_calculator.cc"],
visibility = ["//visibility:public"],
deps = [
":flow_limiter_calculator_cc_proto",
@ -1217,7 +1217,7 @@ cc_test(
cc_library(
name = "constant_side_packet_calculator",
srcs = ["constant_side_packet_calculator.h"],
srcs = ["constant_side_packet_calculator.cc"],
visibility = ["//visibility:public"],
deps = [
":constant_side_packet_calculator_cc_proto",

View File

@ -17,7 +17,7 @@ Example:
load("//mediapipe/framework:encode_binary_proto.bzl", "encode_binary_proto", "generate_proto_descriptor_set")
load("//mediapipe/framework:transitive_protos.bzl", "transitive_protos")
load("//mediapipe/framework/deps:expand_template.bzl", "expand_template")
load("//mediapipe/framework/deps:expand_template.bzl", "expand_template", "expand_template_list")
load("//mediapipe/framework/tool:build_defs.bzl", "clean_dep")
load("//mediapipe/framework/deps:descriptor_set.bzl", "direct_descriptor_set", "transitive_descriptor_set")
load("@org_tensorflow//tensorflow/lite/core/shims:cc_library_with_tflite.bzl", "cc_library_with_tflite")
@ -130,9 +130,14 @@ def mediapipe_simple_subgraph(
outs = [graph_base_name + ".inc"],
)
gen_cpp_file = select({
"//mediapipe:ios": [name + "_linked.h"],
"//conditions:default": [name + "_linked.cc"],
})
# cc_library for a linked mediapipe graph.
expand_template(
name = name + "_linked_cc",
name = name + "_linked_h",
template = clean_dep("//mediapipe/framework/tool:simple_subgraph_template.cc"),
out = name + "_linked.h",
substitutions = {
@ -141,13 +146,23 @@ def mediapipe_simple_subgraph(
},
testonly = testonly,
)
expand_template(
name = name + "_linked_cc",
template = clean_dep("//mediapipe/framework/tool:simple_subgraph_template.cc"),
out = name + "_linked.cc",
substitutions = {
"{{SUBGRAPH_CLASS_NAME}}": register_as,
"{{SUBGRAPH_INC_FILE_PATH}}": native.package_name() + "/" + graph_base_name + ".inc",
},
testonly = testonly,
)
if not tflite_deps:
native.cc_library(
name = name,
srcs = [
name + "_linked.h",
graph_base_name + ".inc",
],
] + gen_cpp_file,
deps = [
clean_dep("//mediapipe/framework:calculator_framework"),
clean_dep("//mediapipe/framework:subgraph"),
@ -161,9 +176,8 @@ def mediapipe_simple_subgraph(
cc_library_with_tflite(
name = name,
srcs = [
name + "_linked.h",
graph_base_name + ".inc",
],
] + gen_cpp_file,
tflite_deps = tflite_deps,
deps = [
clean_dep("//mediapipe/framework:calculator_framework"),