From bc83700b581bbbbf69843b926fa15237da6f09d7 Mon Sep 17 00:00:00 2001 From: Serge Gautherie <32623169+SergeGautherie@users.noreply.github.com> Date: Fri, 8 May 2026 13:10:23 +0200 Subject: [PATCH] [CMAKE] gcc: Allow warnings on CMAKE_BUILD_TYPE=MinSizeRel too (#8332) - Skip -Werror - Also merge amd64 case Follow-up to 0.4.16-dev-848-g 6c7d2a2e25. --- sdk/cmake/gcc.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index d343889db78..83feb26c0da 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -168,7 +168,11 @@ endif() add_compile_options(-march=${OARCH} -mtune=${TUNE}) # Warnings, errors -if((NOT CMAKE_BUILD_TYPE STREQUAL "Release") AND (NOT CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") AND (NOT CMAKE_C_COMPILER_ID STREQUAL Clang)) +if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" AND + NOT ARCH STREQUAL "amd64" AND + NOT CMAKE_BUILD_TYPE STREQUAL "Release" AND + NOT CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" AND + NOT CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") add_compile_options(-Werror) endif() @@ -249,7 +253,6 @@ elseif(ARCH STREQUAL "amd64") if (CMAKE_C_COMPILER_ID STREQUAL "GNU") add_compile_options(-mpreferred-stack-boundary=4) endif() - add_compile_options(-Wno-error) endif() # Other