From 2b53891a7cf83ca151d7912bc78947b9023c4cf0 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Thu, 30 Nov 2023 15:29:19 -0800 Subject: [PATCH] Add lib targets for all C vision tasks PiperOrigin-RevId: 586805240 --- .../tasks/c/vision/image_classifier/BUILD | 34 +++++++++++++++++++ mediapipe/tasks/c/vision/image_embedder/BUILD | 34 +++++++++++++++++++ .../tasks/c/vision/object_detector/BUILD | 34 +++++++++++++++++++ 3 files changed, 102 insertions(+) diff --git a/mediapipe/tasks/c/vision/image_classifier/BUILD b/mediapipe/tasks/c/vision/image_classifier/BUILD index 08a0801d3..b1930fb0e 100644 --- a/mediapipe/tasks/c/vision/image_classifier/BUILD +++ b/mediapipe/tasks/c/vision/image_classifier/BUILD @@ -64,3 +64,37 @@ cc_test( "@com_google_googletest//:gtest_main", ], ) + +# bazel build -c opt --linkopt -s --strip always --define MEDIAPIPE_DISABLE_GPU=1 \ +# //mediapipe/tasks/c/vision/image_classifier:libimage_classifier.so +cc_binary( + name = "libimage_classifier.so", + linkopts = [ + "-Wl,-soname=libimage_classifier.so", + "-fvisibility=hidden", + ], + linkshared = True, + tags = [ + "manual", + "nobuilder", + "notap", + ], + deps = [":image_classifier_lib"], +) + +# bazel build --config darwin_arm64 -c opt --strip always --define MEDIAPIPE_DISABLE_GPU=1 \ +# //mediapipe/tasks/c/vision/image_classifier:libimage_classifier.dylib +cc_binary( + name = "libimage_classifier.dylib", + linkopts = [ + "-Wl,-install_name,libimage_classifier.dylib", + "-fvisibility=hidden", + ], + linkshared = True, + tags = [ + "manual", + "nobuilder", + "notap", + ], + deps = [":image_classifier_lib"], +) diff --git a/mediapipe/tasks/c/vision/image_embedder/BUILD b/mediapipe/tasks/c/vision/image_embedder/BUILD index 4e06e03f9..5d96d90e8 100644 --- a/mediapipe/tasks/c/vision/image_embedder/BUILD +++ b/mediapipe/tasks/c/vision/image_embedder/BUILD @@ -65,3 +65,37 @@ cc_test( "@com_google_googletest//:gtest_main", ], ) + +# bazel build -c opt --linkopt -s --strip always --define MEDIAPIPE_DISABLE_GPU=1 \ +# //mediapipe/tasks/c/vision/image_embedder:libimage_embedder.so +cc_binary( + name = "libimage_embedder.so", + linkopts = [ + "-Wl,-soname=libimage_embedder.so", + "-fvisibility=hidden", + ], + linkshared = True, + tags = [ + "manual", + "nobuilder", + "notap", + ], + deps = [":image_embedder_lib"], +) + +# bazel build --config darwin_arm64 -c opt --strip always --define MEDIAPIPE_DISABLE_GPU=1 \ +# //mediapipe/tasks/c/vision/image_embedder:libimage_embedder.dylib +cc_binary( + name = "libimage_embedder.dylib", + linkopts = [ + "-Wl,-install_name,libimage_embedder.dylib", + "-fvisibility=hidden", + ], + linkshared = True, + tags = [ + "manual", + "nobuilder", + "notap", + ], + deps = [":image_embedder_lib"], +) diff --git a/mediapipe/tasks/c/vision/object_detector/BUILD b/mediapipe/tasks/c/vision/object_detector/BUILD index 28bb6fa91..01c6d772d 100644 --- a/mediapipe/tasks/c/vision/object_detector/BUILD +++ b/mediapipe/tasks/c/vision/object_detector/BUILD @@ -63,3 +63,37 @@ cc_test( "@com_google_googletest//:gtest_main", ], ) + +# bazel build -c opt --linkopt -s --strip always --define MEDIAPIPE_DISABLE_GPU=1 \ +# //mediapipe/tasks/c/vision/object_detector:libobject_detector.so +cc_binary( + name = "libobject_detector.so", + linkopts = [ + "-Wl,-soname=libobject_detector.so", + "-fvisibility=hidden", + ], + linkshared = True, + tags = [ + "manual", + "nobuilder", + "notap", + ], + deps = [":object_detector_lib"], +) + +# bazel build --config darwin_arm64 -c opt --strip always --define MEDIAPIPE_DISABLE_GPU=1 \ +# //mediapipe/tasks/c/vision/object_detector:libobject_detector.dylib +cc_binary( + name = "libobject_detector.dylib", + linkopts = [ + "-Wl,-install_name,libobject_detector.dylib", + "-fvisibility=hidden", + ], + linkshared = True, + tags = [ + "manual", + "nobuilder", + "notap", + ], + deps = [":object_detector_lib"], +)