Skip to content

Commit

Permalink
third_party/pico_sdk: Selectively disable elf2uf2 warnings
Browse files Browse the repository at this point in the history
As a quick fix, the strict_warnings flag was removed from the elf2uf2
tool to get it to build on Windows. This change reverts that, and
instead selectively disables the appropriate warnings to allow the tool
to build on Windows with gcc.

Bug: b/300474559
Change-Id: I93277be814edfff43ff9156a90fcde7442c62f62
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/171072
Pigweed-Auto-Submit: Armando Montanez <[email protected]>
Reviewed-by: Anthony DiGirolamo <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
Presubmit-Verified: CQ Bot Account <[email protected]>
  • Loading branch information
armandomontanez authored and CQ Bot Account committed Sep 18, 2023
1 parent 0c5eb3d commit 7c74e21
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 11 additions & 0 deletions third_party/pico_sdk/gn/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# License for the specific language governing permissions and limitations under
# the License.

import("//build_overrides/pi_pico.gni")

# These warnings need to be disabled when using strict warnings.
config("disable_warnings") {
cflags = [
Expand All @@ -21,3 +23,12 @@ config("disable_warnings") {
]
asmflags = cflags
}

config("disable_elf2uf2_warnings") {
cflags = [
"-Wno-shadow",
"-Wno-reorder",
"-Wno-type-limits",
]
visibility = [ "${PICO_ROOT}/src:elf2uf2" ]
}
5 changes: 1 addition & 4 deletions third_party/pico_sdk/src/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ config("elf2uf2_configs") {
pw_executable("elf2uf2") {
configs = [
":elf2uf2_configs",
"${PICO_ROOT}/gn:disable_elf2uf2_warnings",
"${PICO_ROOT}/gn:disable_warnings",
]
sources = [ "$PICO_SRC_DIR/tools/elf2uf2/main.cpp" ]

if (host_os == "win") {
remove_configs = [ "$dir_pw_build:strict_warnings" ]
}
}

0 comments on commit 7c74e21

Please sign in to comment.