Skip to content

Commit a0fce0b

Browse files
authored
[bazel] Use non_arc_srcs instead of passing -fno-objc-arc (#137037)
This is the recommended way in bazel to differentiate between files that require arc and those that require it be disabled. This matters depending on the toolchain since the order of these flags may not have been correct and we were relying on overwriting the default.
1 parent 5bb4cf9 commit a0fce0b

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

utils/bazel/llvm-project-overlay/lldb/BUILD.bazel

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,8 @@ cc_library(
484484

485485
objc_library(
486486
name = "HostMacOSXObjCXX",
487-
srcs = glob([
488-
"source/Host/macosx/objcxx/*.mm",
489-
]),
490487
copts = OBJCPP_COPTS,
488+
non_arc_srcs = glob(["source/Host/macosx/objcxx/*.mm"]),
491489
tags = ["nobuildkite"],
492490
target_compatible_with = select({
493491
"@platforms//os:macos": [],
@@ -832,9 +830,9 @@ cc_binary(
832830
deps = [
833831
":APIHeaders",
834832
":Host",
833+
":UtilityHeaders",
835834
":liblldb.wrapper",
836835
":lldb_options_inc_gen",
837-
":UtilityHeaders",
838836
"//llvm:Option",
839837
"//llvm:Support",
840838
],
@@ -855,8 +853,8 @@ cc_library(
855853

856854
objc_library(
857855
name = "DebugServerMacOSX",
858-
srcs = glob(["tools/debugserver/source/MacOSX/*.mm"]),
859856
copts = OBJCPP_COPTS,
857+
non_arc_srcs = glob(["tools/debugserver/source/MacOSX/*.mm"]),
860858
tags = ["nobuildkite"],
861859
target_compatible_with = select({
862860
"@platforms//os:macos": [],

utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ cc_library(
238238

239239
objc_library(
240240
name = "PluginPlatformMacOSXObjCXX",
241-
srcs = glob(["Platform/MacOSX/objcxx/*.mm"]),
242241
copts = OBJCPP_COPTS,
242+
non_arc_srcs = glob(["Platform/MacOSX/objcxx/*.mm"]),
243243
tags = ["nobuildkite"],
244244
target_compatible_with = select({
245245
"@platforms//os:macos": [],

utils/bazel/llvm-project-overlay/lldb/source/Plugins/plugin_config.bzl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,5 @@ DEFAULT_SCRIPT_PLUGINS = [
9999
OBJCPP_COPTS = [
100100
"-std=c++{}".format(CMAKE_CXX_STANDARD),
101101
"-fno-objc-exceptions",
102-
"-fno-objc-arc",
103102
"-Wno-shorten-64-to-32",
104103
]

0 commit comments

Comments
 (0)