From d04e15b957bd59f7f9b3a4d3433e567505c43045 Mon Sep 17 00:00:00 2001 From: David Vo Date: Sat, 26 Apr 2025 03:37:42 +1000 Subject: [PATCH] [bazel] Avoid globally linking macOS SDK frameworks (#7927) --- cscore/BUILD.bazel | 7 +++++++ shared/bazel/compiler_flags/osx_flags.rc | 11 ----------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/cscore/BUILD.bazel b/cscore/BUILD.bazel index d40fb4d2fd..8533fde451 100644 --- a/cscore/BUILD.bazel +++ b/cscore/BUILD.bazel @@ -40,6 +40,13 @@ objc_library( "src/main/native/include", "src/main/native/objcpp", ], + sdk_frameworks = [ + "CoreFoundation", + "AVFoundation", + "Foundation", + "CoreMedia", + "CoreVideo", + ], tags = ["manual"], deps = [ "//wpinet:wpinet.static", diff --git a/shared/bazel/compiler_flags/osx_flags.rc b/shared/bazel/compiler_flags/osx_flags.rc index 2aa48df280..fd71773579 100644 --- a/shared/bazel/compiler_flags/osx_flags.rc +++ b/shared/bazel/compiler_flags/osx_flags.rc @@ -26,17 +26,6 @@ build:macos --conlyopt=-Wno-missing-field-initializers build:macos --conlyopt=-Wno-unused-private-field build:macos --conlyopt=-Wno-fixed-enum-extension" - -build:macos --linkopt=-framework -build:macos --linkopt=CoreFoundation -build:macos --linkopt=-framework -build:macos --linkopt=AVFoundation -build:macos --linkopt=-framework -build:macos --linkopt=Foundation -build:macos --linkopt=-framework -build:macos --linkopt=CoreMedia -build:macos --linkopt=-framework -build:macos --linkopt=CoreVideo build:macos --linkopt=-headerpad_max_install_names build:macos --linkopt=-Wl,-rpath,'@loader_path'"