From 7c74e216709f134996fd35ace4a78cbd0c16cae1 Mon Sep 17 00:00:00 2001 From: Armando Montanez Date: Mon, 18 Sep 2023 21:43:31 +0000 Subject: [PATCH] third_party/pico_sdk: Selectively disable elf2uf2 warnings 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 Reviewed-by: Anthony DiGirolamo Commit-Queue: Auto-Submit Presubmit-Verified: CQ Bot Account --- third_party/pico_sdk/gn/BUILD.gn | 11 +++++++++++ third_party/pico_sdk/src/BUILD.gn | 5 +---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/third_party/pico_sdk/gn/BUILD.gn b/third_party/pico_sdk/gn/BUILD.gn index 8234f01c13..eba2bc71e0 100644 --- a/third_party/pico_sdk/gn/BUILD.gn +++ b/third_party/pico_sdk/gn/BUILD.gn @@ -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 = [ @@ -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" ] +} diff --git a/third_party/pico_sdk/src/BUILD.gn b/third_party/pico_sdk/src/BUILD.gn index e79a85f78c..059d3a4771 100644 --- a/third_party/pico_sdk/src/BUILD.gn +++ b/third_party/pico_sdk/src/BUILD.gn @@ -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" ] - } }