Skip to content

Commit 39a4707

Browse files
authored
Add -DDEBUG and -O0 for dbg compiles (#556)
In the past for Objective-C these came from incompatible_avoid_hardcoded_objc_compilation_flags, which was flipped in bazel 9.x. We pass these 2 for fastbuild as well.
1 parent a07964f commit 39a4707

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

crosstool/cc_toolchain_config.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,7 @@ please file an issue at https://github.com/bazelbuild/apple_support/issues/new
16381638
ACTION_NAMES.objc_compile,
16391639
ACTION_NAMES.objcpp_compile,
16401640
],
1641-
flag_groups = [flag_group(flags = ["-g"])],
1641+
flag_groups = [flag_group(flags = ["-O0", "-DDEBUG", "-g"])],
16421642
with_features = [with_feature_set(features = ["dbg"])],
16431643
),
16441644
],

test/compiling_tests.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,13 +378,13 @@ def compiling_test_suite(name):
378378
expected_argv = [
379379
"-D_FORTIFY_SOURCE=1",
380380
"-fstack-protector",
381+
"-O0",
382+
"-DDEBUG",
381383
"-g",
382384
],
383385
not_expected_argv = [
384-
"-DDEBUG",
385386
"-DNDEBUG",
386387
"-g0",
387-
"-O0",
388388
"-O2",
389389
],
390390
mnemonic = "CppCompile",

0 commit comments

Comments
 (0)