From 4b5ceb9dd0464cc828fd43e00105d331a4a5bf1b Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Fri, 17 Jan 2025 11:47:14 -0800 Subject: [PATCH] cmake: compiler/xt-clang: add -Wno-unknown-warning-option xt-clang is usually based on older version of clang, and Zephyr main targets more recent versions. Because of this, some newer compiler flags may cause warnings where twister would mark as test being failed. To workaround that, add -Wno-unknown-warning-option to suppress those warnings. Fixes #84138 Signed-off-by: Daniel Leung --- cmake/compiler/xt-clang/compiler_flags.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake/compiler/xt-clang/compiler_flags.cmake b/cmake/compiler/xt-clang/compiler_flags.cmake index 593e3842843..c70832ebc0f 100644 --- a/cmake/compiler/xt-clang/compiler_flags.cmake +++ b/cmake/compiler/xt-clang/compiler_flags.cmake @@ -34,3 +34,12 @@ set_compiler_property(PROPERTY no_position_independent "") # Remove after testing that -Wshadow works set_compiler_property(PROPERTY warning_shadow_variables) + +# xt-clang is usually based on older version of clang, and +# Zephyr main targets more recent versions. Because of this, +# some newer compiler flags may cause warnings where twister +# would mark as test being failed. To workaround that, +# add -Wno-unknown-warning-option to suppress those warnings. +check_set_compiler_property(APPEND PROPERTY warning_extended + -Wno-unknown-warning-option +)