mirror of https://github.com/mongodb/mongo
SERVER-106542: Specify the debug flags for MacOS builds. (#37593)
GitOrigin-RevId: 014e6be9968050cfffbfb9330709ae5150507670
This commit is contained in:
parent
bb7cafef53
commit
1b11987d0b
|
|
@ -14,6 +14,13 @@ filegroup(
|
|||
srcs = glob(["**/*"]),
|
||||
)
|
||||
|
||||
DEBUG_LEVEL = select({
|
||||
"@//bazel/config:gcc_or_clang_dbg_level_0": 0,
|
||||
"@//bazel/config:gcc_or_clang_dbg_level_1": 1,
|
||||
"@//bazel/config:gcc_or_clang_dbg_level_2": 2,
|
||||
"@//bazel/config:gcc_or_clang_dbg_level_3": 3,
|
||||
})
|
||||
|
||||
[
|
||||
cc_toolchain(
|
||||
name = "cc-compiler-" + arch,
|
||||
|
|
@ -64,6 +71,7 @@ feature_attrs = get_common_features_attrs()
|
|||
},
|
||||
builtin_sysroot = "@//bazel/config:sdkroot",
|
||||
optimization_level = feature_attrs[FEATURES_ATTR_NAMES.OPT_LEVEL],
|
||||
debug_level = DEBUG_LEVEL,
|
||||
)
|
||||
for arch, cpu in get_supported_apple_archs().items()
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1719,6 +1719,7 @@ mongo_apple_llvm_cc_toolchain_config = rule(
|
|||
"unfiltered_compile_flags": attr.string_list(),
|
||||
"builtin_sysroot": attr.label(mandatory = True),
|
||||
"optimization_level": attr.string(mandatory = False),
|
||||
"debug_level": attr.int(mandatory = False),
|
||||
},
|
||||
fragments = ["apple", "cpp"],
|
||||
provides = [CcToolchainConfigInfo],
|
||||
|
|
|
|||
|
|
@ -188,4 +188,72 @@ def get_apple_features(ctx):
|
|||
),
|
||||
],
|
||||
),
|
||||
# TODO(SERVER-105741): feature g0, g1, g2, g3 were copied from ../mongo_linux/mongo_linux_cc_toolchain_config.bzl file.
|
||||
# Since we are combining the Linux and Apple toolchains config together, the merging of the
|
||||
# debug_level feature will be done at the same time. Need to pay attention to the disable_debug_symbols
|
||||
# attribute and other implied features in mongo_linux_cc_toolchain_config.bzl file during the merge.
|
||||
feature(
|
||||
name = "g0",
|
||||
enabled = ctx.attr.debug_level == 0,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = all_compile_actions,
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = [
|
||||
"-g0",
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
feature(
|
||||
name = "g1",
|
||||
enabled = ctx.attr.debug_level == 1,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = all_compile_actions,
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = [
|
||||
"-g1",
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
feature(
|
||||
name = "g2",
|
||||
enabled = ctx.attr.debug_level == 2,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = all_compile_actions,
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = [
|
||||
"-g2",
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
feature(
|
||||
name = "g3",
|
||||
enabled = ctx.attr.debug_level == 3,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = all_compile_actions,
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = [
|
||||
"-g3",
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in New Issue