Update rules_foreign_cc

Fixes https://github.com/google/mediapipe/issues/4365

PiperOrigin-RevId: 538301543
This commit is contained in:
Sebastian Schmidt 2023-06-06 15:03:56 -07:00 committed by Copybara-Service
parent d063ed2c1e
commit 4a123445c4
2 changed files with 9 additions and 8 deletions

View File

@ -46,11 +46,12 @@ http_archive(
http_archive(
name = "rules_foreign_cc",
strip_prefix = "rules_foreign_cc-0.1.0",
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.1.0.zip",
sha256 = "2a4d07cd64b0719b39a7c12218a3e507672b82a97b98c6a89d38565894cf7c51",
strip_prefix = "rules_foreign_cc-0.9.0",
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/refs/tags/0.9.0.tar.gz",
)
load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies")
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
rules_foreign_cc_dependencies()

8
third_party/BUILD vendored
View File

@ -13,7 +13,7 @@
# limitations under the License.
#
load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external")
load("@rules_foreign_cc//foreign_cc:cmake.bzl", "cmake")
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
licenses(["notice"]) # Apache License 2.0
@ -154,7 +154,7 @@ OPENCV_SHARED_LIBS = True
OPENCV_SO_VERSION = "3.4"
cmake_external(
cmake(
name = "opencv_cmake",
# Values to be passed as -Dkey=value on the CMake command line;
# here are serving to provide some CMake script configuration options
@ -230,7 +230,7 @@ cmake_external(
"-lpthread",
"-lrt",
],
shared_libraries = select({
out_shared_libs = select({
"@bazel_tools//src/conditions:darwin": ["libopencv_%s.%s.dylib" % (module, OPENCV_SO_VERSION) for module in OPENCV_MODULES],
# Only the shared objects listed here will be linked in the directory
# that Bazel adds to the RUNPATH of dependent executables. You cannot
@ -238,7 +238,7 @@ cmake_external(
# versioned name is the one that the executables actually reference.
"//conditions:default": ["libopencv_%s.so.%s" % (module, OPENCV_SO_VERSION) for module in OPENCV_MODULES],
}) if OPENCV_SHARED_LIBS else None,
static_libraries = [
out_static_libs = [
"libopencv_%s.a" % module
for module in OPENCV_MODULES
] if not OPENCV_SHARED_LIBS else None,