From aafb0162f484d75991438d14339c9ddeff77743e Mon Sep 17 00:00:00 2001 From: Prianka Liz Kariat Date: Fri, 28 Apr 2023 03:17:22 +0530 Subject: [PATCH] Added config settings to select building iOS xcframework from source for certain configs --- third_party/BUILD | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/third_party/BUILD b/third_party/BUILD index 7522bab1b..3c3710d9e 100644 --- a/third_party/BUILD +++ b/third_party/BUILD @@ -61,10 +61,56 @@ config_setting( visibility = ["//visibility:public"], ) +config_setting( + name = "opencv_ios_arm64_source_build", + values = { + "apple_platform_type": "ios", + "cpu": "ios_arm64" + }, + define_values = { + "OPENCV": "source", + }, +) + +config_setting( + name = "opencv_ios_sim_arm64_source_build", + values = { + "config": "ios_sim_arm64", + }, + define_values = { + "OPENCV": "source", + }, +) + +config_setting( + name = "opencv_ios_x86_64_source_build", + values = { + "apple_platform_type": "ios", + "cpu": "ios_x86_64" + }, + define_values = { + "OPENCV": "source", + }, +) + +config_setting( + name = "opencv_ios_sim_fat_source_build", + values = { + "config": "ios_sim_fat", + }, + define_values = { + "OPENCV": "source", + }, +) + alias( name = "opencv", actual = select({ ":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", }), visibility = ["//visibility:public"],