From bdede4f94ec3971d0c5f1471ff8fefd96b59a433 Mon Sep 17 00:00:00 2001 From: Prianka Liz Kariat Date: Fri, 28 Apr 2023 03:26:29 +0530 Subject: [PATCH] Updated select conditions --- mediapipe/BUILD | 1 + mediapipe/tasks/ios/vision/core/BUILD | 17 +++++++++++++++-- third_party/BUILD | 9 +++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/mediapipe/BUILD b/mediapipe/BUILD index 3187c0cf7..fd0cbab36 100644 --- a/mediapipe/BUILD +++ b/mediapipe/BUILD @@ -141,6 +141,7 @@ config_setting( "ios_armv7", "ios_arm64", "ios_arm64e", + "ios_sim_arm64", ] ] diff --git a/mediapipe/tasks/ios/vision/core/BUILD b/mediapipe/tasks/ios/vision/core/BUILD index 4b72fc91d..0ea54fbcf 100644 --- a/mediapipe/tasks/ios/vision/core/BUILD +++ b/mediapipe/tasks/ios/vision/core/BUILD @@ -61,6 +61,19 @@ objc_library( "//mediapipe/tasks/ios/core:MPPTaskRunner", "//third_party/apple_frameworks:UIKit", "@com_google_absl//absl/status:statusor", - "@ios_opencv//:OpencvFramework", - ], + ] + select({ + "@//third_party:opencv_ios_sim_arm64_source_build" : [ + "@ios_opencv_source//:opencv_xcframework" + ], + "@//third_party:opencv_ios_sim_fat_source_build" : [ + "@ios_opencv_source//:opencv_xcframework" + ], + "@//third_party:opencv_ios_arm64_source_build" : [ + "@ios_opencv_source//:opencv_xcframework" + ], + "//conditions:default": [ + "@ios_opencv//:OpencvFramework" + ], + }) + ) diff --git a/third_party/BUILD b/third_party/BUILD index 3c3710d9e..ce1e1bf73 100644 --- a/third_party/BUILD +++ b/third_party/BUILD @@ -65,7 +65,7 @@ config_setting( name = "opencv_ios_arm64_source_build", values = { "apple_platform_type": "ios", - "cpu": "ios_arm64" + "cpu": "ios_arm64", }, define_values = { "OPENCV": "source", @@ -75,7 +75,8 @@ config_setting( config_setting( name = "opencv_ios_sim_arm64_source_build", values = { - "config": "ios_sim_arm64", + "apple_platform_type": "ios", + "cpu": "ios_sim_arm64", }, define_values = { "OPENCV": "source", @@ -96,7 +97,8 @@ config_setting( config_setting( name = "opencv_ios_sim_fat_source_build", values = { - "config": "ios_sim_fat", + "apple_platform_type": "ios", + "ios_multi_cpus": "sim_arm64, x86_64" }, define_values = { "OPENCV": "source", @@ -109,7 +111,6 @@ alias( ":opencv_source_build": ":opencv_cmake", ":opencv_ios_sim_arm64_source_build" : "@ios_opencv_source//:opencv", ":opencv_ios_sim_fat_source_build" : "@ios_opencv_source//:opencv", - ":opencv_ios_sim_arm64_source_build" : "@ios_opencv_source//:opencv", ":opencv_ios_arm64_source_build" : "@ios_opencv_source//:opencv", "//conditions:default": ":opencv_binary", }),