-
Couldn't load subscription status.
- Fork 1.1k
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
Changes from 1 commit
c565e26
39dc067
f956772
525aa94
e346e6d
f5b3b9f
9ac79e0
9ae798d
0bbbe6d
c7b4c9b
55344e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -89,15 +89,33 @@ cc_args( | |
| ) | ||
|
|
||
| cc_args( | ||
| name = "opt_debug_args", | ||
| name = "debug_args", | ||
| actions = [ | ||
| "@rules_cc//cc/toolchains/actions:compile_actions", | ||
| "@rules_cc//cc/toolchains/actions:link_actions", | ||
| ], | ||
| args = [ | ||
| "-Og", # TODO: Make this configurable. | ||
| "-g3", | ||
| args = select({ | ||
| "//bazel/constraint:pico_compiliation_debug_override": [], | ||
| "//conditions:default": [ | ||
| "-Og", | ||
| "-g3", | ||
| ], | ||
| }) | ||
| ) | ||
|
|
||
| cc_args( | ||
| name = "opt_args", | ||
| actions = [ | ||
| "@rules_cc//cc/toolchains/actions:compile_actions", | ||
| "@rules_cc//cc/toolchains/actions:link_actions", | ||
| ], | ||
| args = select({ | ||
| "//bazel/constraint:pico_compiliation_opt_override": [], | ||
| "//conditions:default": [ | ||
| "-O2", | ||
| "-DNDEBUG", | ||
| ], | ||
| }) | ||
| ) | ||
|
|
||
| configurable_toolchain_feature( | ||
|
|
@@ -134,16 +152,27 @@ configurable_toolchain_feature( | |
|
|
||
| # TODO: Make this shim unnecessary. | ||
|
||
| cc_args_list( | ||
| name = "all_opt_debug_args", | ||
| args = [":opt_debug_args"], | ||
| name = "all_debug_args", | ||
| args = [":debug_args"], | ||
| ) | ||
|
|
||
| cc_args_list( | ||
| name = "all_opt_args", | ||
| args = [":opt_args"], | ||
| ) | ||
|
|
||
| cc_feature( | ||
| name = "override_debug", | ||
| args = [":all_opt_debug_args"], | ||
| name = "dbg", | ||
| args = [":all_debug_args"], | ||
| overrides = "@rules_cc//cc/toolchains/features:dbg", | ||
| ) | ||
|
|
||
| cc_feature( | ||
| name = "opt", | ||
| args = [":all_opt_args"], | ||
| overrides = "@rules_cc//cc/toolchains/features:opt", | ||
| ) | ||
|
|
||
| HOSTS = ( | ||
| ("linux", "x86_64"), | ||
| ("linux", "aarch64"), | ||
|
|
@@ -180,7 +209,8 @@ _HOST_CPU_CONSTRAINTS = { | |
| tags = ["manual"], # Don't try to build this in wildcard builds. | ||
| known_features = [ | ||
| "@rules_cc//cc/toolchains/args:experimental_replace_legacy_action_config_features", | ||
| "@pico-sdk//bazel/toolchain:override_debug", | ||
| "@pico-sdk//bazel/toolchain:dbg", | ||
| "@pico-sdk//bazel/toolchain:opt", | ||
| "@pico-sdk//bazel/toolchain:gc_sections", | ||
| "@pico-sdk//bazel/toolchain:cxx_no_exceptions", | ||
| "@pico-sdk//bazel/toolchain:cxx_no_rtti", | ||
|
|
@@ -189,7 +219,6 @@ _HOST_CPU_CONSTRAINTS = { | |
| ], | ||
| enabled_features = [ | ||
| "@rules_cc//cc/toolchains/args:experimental_replace_legacy_action_config_features", | ||
| "@pico-sdk//bazel/toolchain:override_debug", | ||
| ] + select({ | ||
| "//bazel/constraint:pico_no_gc_sections_enabled": [], | ||
| "//conditions:default": [":gc_sections"], | ||
|
|
@@ -232,7 +261,8 @@ _HOST_CPU_CONSTRAINTS = { | |
| tags = ["manual"], # Don't try to build this in wildcard builds. | ||
| known_features = [ | ||
| "@rules_cc//cc/toolchains/args:experimental_replace_legacy_action_config_features", | ||
| "@pico-sdk//bazel/toolchain:override_debug", | ||
| "@pico-sdk//bazel/toolchain:dbg", | ||
| "@pico-sdk//bazel/toolchain:opt", | ||
| "@pico-sdk//bazel/toolchain:gc_sections", | ||
| "@pico-sdk//bazel/toolchain:cxx_no_exceptions", | ||
| "@pico-sdk//bazel/toolchain:cxx_no_rtti", | ||
|
|
@@ -241,7 +271,6 @@ _HOST_CPU_CONSTRAINTS = { | |
| ], | ||
| enabled_features = [ | ||
| "@rules_cc//cc/toolchains/args:experimental_replace_legacy_action_config_features", | ||
| "@pico-sdk//bazel/toolchain:override_debug", | ||
| ] + select({ | ||
| "//bazel/constraint:pico_no_gc_sections_enabled": [], | ||
| "//conditions:default": [":gc_sections"], | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add docstrings above these and add them to the exclusion list in
BAZEL_ONLY_ALLOWLISThere.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, Thanks. These have been added.