Change naming of flags from PICO_COMPILATION_XXX_REMOVE_DEFS to PICO_COMPILATION_NO_XXX_ARGS for OPT, FASTBUILD & DEBUG variants

This commit is contained in:
Brad Nolan 2025-04-14 18:14:47 +12:00
parent 9ae798d3e2
commit 0bbbe6d19a
4 changed files with 21 additions and 23 deletions

View File

@ -300,21 +300,19 @@ label_flag(
name = "PICO_MBEDTLS_CONFIG",
build_setting_default = "//bazel:empty_cc_lib",
)
# PICO_BAZEL_CONFIG: PICO_COMPILATION_OPT_REMOVE_DEFS, Remove the default opt compilation mode arguments, type=bool, default=0, group=build
# PICO_BAZEL_CONFIG: PICO_COMPILATION_NO_OPT_ARGS, Makes the opt compilation mode a no-op so custom optimization arguments can be injected via the --copt flag instead, type=bool, default=0, group=build
bool_flag(
name = "PICO_COMPILATION_OPT_REMOVE_DEFS",
name = "PICO_COMPILATION_NO_OPT_ARGS",
build_setting_default = False,
)
# PICO_BAZEL_CONFIG: PICO_COMPILATION_NO_DEBUG_ARGS, Makes the debug compilation mode a no-op so custom optimization arguments can be injected via the --copt flag instead, type=bool, default=0, group=build
bool_flag(
name = "PICO_COMPILATION_NO_DEBUG_ARGS",
build_setting_default = False,
)
# PICO_BAZEL_CONFIG: PICO_COMPILATION_DEBUG_REMOVE_DEFS, Remove the default dbg compilation mode arguments, type=bool, default=0, group=build
# PICO_BAZEL_CONFIG: PICO_COMPILATION_NO_FASTBUILD_ARGS, Makes the fastbuild compilation mode a no-op so custom optimization arguments can be injected via the --copt flag instead, type=bool, default=0, group=build
bool_flag(
name = "PICO_COMPILATION_DEBUG_REMOVE_DEFS",
build_setting_default = False,
)
# PICO_BAZEL_CONFIG: PICO_COMPILATION_FASTBUILD_REMOVE_DEFS, Remove the default fastbuild compilation mode arguments, type=bool, default=0, group=build
bool_flag(
name = "PICO_COMPILATION_FASTBUILD_REMOVE_DEFS",
name = "PICO_COMPILATION_NO_FASTBUILD_ARGS",
build_setting_default = False,
)

View File

@ -260,16 +260,16 @@ label_flag_matches(
)
config_setting(
name = "pico_compiliation_opt_remove_defs",
flag_values = {"//bazel/config:PICO_COMPILATION_OPT_REMOVE_DEFS": "True"},
name = "pico_compiliation_no_opt_args_set",
flag_values = {"//bazel/config:PICO_COMPILATION_NO_OPT_ARGS": "True"},
)
config_setting(
name = "pico_compiliation_debug_remove_defs",
flag_values = {"//bazel/config:PICO_COMPILATION_DEBUG_REMOVE_DEFS": "True"},
name = "pico_compiliation_no_debug_args_set",
flag_values = {"//bazel/config:PICO_COMPILATION_NO_DEBUG_ARGS": "True"},
)
config_setting(
name = "pico_compiliation_fastbuild_remove_defs",
flag_values = {"//bazel/config:PICO_COMPILATION_FASTBUILD_REMOVE_DEFS": "True"},
name = "pico_compiliation_no_fastbuild_args_set",
flag_values = {"//bazel/config:PICO_COMPILATION_NO_FASBUILD_ARGS": "True"},
)

View File

@ -95,7 +95,7 @@ cc_args(
"@rules_cc//cc/toolchains/actions:link_actions",
],
args = select({
"//bazel/constraint:pico_compiliation_debug_remove_defs": [],
"//bazel/constraint:pico_compiliation_no_debug_args_set": [],
"//conditions:default": [
"-Og",
"-g3",
@ -110,7 +110,7 @@ cc_args(
"@rules_cc//cc/toolchains/actions:link_actions",
],
args = select({
"//bazel/constraint:pico_compiliation_opt_remove_defs": [],
"//bazel/constraint:pico_compiliation_no_opt_args_set": [],
"//conditions:default": [
"-O2",
"-DNDEBUG",
@ -125,7 +125,7 @@ cc_args(
"@rules_cc//cc/toolchains/actions:link_actions",
],
args = select({
"//bazel/constraint:pico_compiliation_fastbuild_remove_defs": [],
"//bazel/constraint:pico_compiliation_no_fastbuild_args_set": [],
# The conditions default are kept as nothing here, The bazel docs default are -gmlt -Wl,-S.
"//conditions:default": [],
})

View File

@ -159,9 +159,9 @@ BAZEL_ONLY_ALLOWLIST = (
"PICO_BT_ENABLE_CLASSIC",
"PICO_BT_ENABLE_MESH",
# Compilation modes remove, These allow the user to remove the defaults, with no args. See --compilation_mode cmd line option
"PICO_COMPILATION_FASTBUILD_REMOVE_DEFS",
"PICO_COMPILATION_DEBUG_REMOVE_DEFS",
"PICO_COMPILATION_OPT_REMOVE_DEFS",
"PICO_COMPILATION_NO_OPT_ARGS",
"PICO_COMPILATION_NO_DEBUG_ARGS",
"PICO_COMPILATION_NO_FASTBUILD_ARGS",
)