[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.
This commit is contained in:
Serge Gautherie
2026-05-08 14:10:23 +03:00
committed by GitHub
parent 15c9005acb
commit bc83700b58
+5 -2
View File
@@ -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