summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2023-04-19 16:34:30 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-26 00:46:05 +0000
commitea8f5b29edd2817528f63be93bbf3fdd9c2ad2d5 (patch)
treee0054d41b5b9e668f079210ee5607cfab4277ba6
parent60f8aece2b85205591a12c6abdb7faa9443943de (diff)
downloadchrome-ec-ea8f5b29edd2817528f63be93bbf3fdd9c2ad2d5.tar.gz
zmake: Use CONFIG_COMPILER_WARNINGS_AS_ERRORS
Zephyr provides the Kconfig option COMPILER_WARNINGS_AS_ERRORS to automatically treat warnings as errors. Use this Kcoonfig in place of an EC specific Cmake option. BUG=none BRANCH=none TEST=zmake build skyrim. Confirm compiler options enable "-Werror" TEST=zmake build skyrim --allow-warnings. Confirm compiler options don't include "-Werror" Change-Id: I9ea85928a9125472bbf00bac6ee452b4ab97fdf9 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4451647 Reviewed-by: Tristan Honscheid <honscheid@google.com>
-rw-r--r--zephyr/CMakeLists.txt6
-rw-r--r--zephyr/zmake/zmake/zmake.py4
2 files changed, 2 insertions, 8 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt
index 63dc674b05..d27cd63597 100644
--- a/zephyr/CMakeLists.txt
+++ b/zephyr/CMakeLists.txt
@@ -45,12 +45,6 @@ if(DEFINED CONFIG_PLATFORM_EC)
# with Zephyr builds only.
zephyr_compile_definitions("CONFIG_ZEPHYR")
- # Force compiler warnings to generate errors
- option(ALLOW_WARNINGS "Do not treat warnings as errors")
- if (NOT ALLOW_WARNINGS)
- zephyr_compile_options(-Werror)
- endif()
-
include(fpu.cmake)
# When LTO is enabled, enable only for the "app" library, which compiles
diff --git a/zephyr/zmake/zmake/zmake.py b/zephyr/zmake/zmake/zmake.py
index 4c6d840535..7457a16740 100644
--- a/zephyr/zmake/zmake/zmake.py
+++ b/zephyr/zmake/zmake/zmake.py
@@ -521,9 +521,9 @@ class Zmake:
base_config |= zmake.build_config.BuildConfig(
kconfig_defs={"CONFIG_COMPILER_SAVE_TEMPS": "y"}
)
- if allow_warnings:
+ if not allow_warnings:
base_config |= zmake.build_config.BuildConfig(
- cmake_defs={"ALLOW_WARNINGS": "ON"}
+ kconfig_defs={"CONFIG_COMPILER_WARNINGS_AS_ERRORS": "y"}
)
if extra_cflags:
base_config |= zmake.build_config.BuildConfig(