From cf6dbef20a9ba083ea1616f556c508a8a79784e7 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 19 Jan 2026 19:38:35 +0200 Subject: [PATCH] [CMAKE] gcc.cmake: Move all warning options into the same place --- sdk/cmake/gcc.cmake | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index 0bcd9f40464..da017d28a2c 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -52,7 +52,6 @@ add_compile_options(-mlong-double-64) add_compile_options("$<$>:-nostdinc>") if(CMAKE_C_COMPILER_ID STREQUAL "GNU") - add_compile_options("-Wno-unknown-pragmas") add_compile_options(-fno-aggressive-loop-optimizations) if (DBG) add_compile_options("$<$:-Wold-style-declaration>") @@ -129,8 +128,6 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU") endif() elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang") - add_compile_options("$<$:-Wno-microsoft>") - add_compile_options(-Wno-pragma-pack) add_compile_options(-fno-associative-math) if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0) @@ -191,8 +188,14 @@ if(ARCH STREQUAL "arm") add_compile_options(-Wno-attributes) endif() -if(CMAKE_C_COMPILER_ID STREQUAL "Clang") +if(CMAKE_C_COMPILER_ID STREQUAL "GNU") add_compile_options( + -Wno-unknown-pragmas + ) +elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang") + add_compile_options("$<$:-Wno-microsoft>") + add_compile_options( + -Wno-pragma-pack -Wno-unknown-warning-option ) endif()