8000 Bazel build implementation, doesn't provide options for the compilation modes opt and debug by NolanBrad · Pull Request #2395 · raspberrypi/pico-sdk · GitHub
[go: up one dir, main page]

Skip to content

Bazel build implementation, doesn't provide options for the compilation modes opt and debug #2395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change naming of flags from PICO_COMPILATION_XXX_REMOVE_DEFS to PICO_…
…COMPILATION_NO_XXX_ARGS for OPT, FASTBUILD & DEBUG variants
  • Loading branch information
NolanBrad committed Apr 14, 2025
commit 0bbbe6d19a7c27fd723b9e31bf1611db759441bc
14 changes: 6 additions & 8 deletions bazel/config/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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_DEBUG_REMOVE_DEFS, Remove the default dbg compilation mode arguments, type=bool, default=0, group=build
# 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_DEBUG_REMOVE_DEFS",
name = "PICO_COMPILATION_NO_DEBUG_ARGS",
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
# 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_FASTBUILD_REMOVE_DEFS",
name = "PICO_COMPILATION_NO_FASTBUILD_ARGS",
build_setting_default = False,
)
12 changes: 6 additions & 6 deletions bazel/constraint/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
)
6 changes: 3 additions & 3 8000 deletions bazel/toolchain/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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": [],
})
Expand Down
6 changes: 3 additions & 3 deletions tools/compare_build_systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@
"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",
)


Expand Down
0