aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorshiv121231 <127076592+shiv121231@users.noreply.github.com>2026-11-01 01:19:37 +1100
committerGitHub <noreply@github.com>2026-11-01 01:19:37 +1100
commitbcb98dc1f7a8d4ab58970292a28b8d9946fbf05e (patch)
treed365efc0066eadbd4b42876a38f97a3fed53affb /CMakeLists.txt
parentaf7289e62fe0125caa9542f47875e8f99ae98355 (diff)
Implement platform-specific handling for -Werror
Added handling for specific -Werror downgrades across platforms in CMake.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fb2b96ed05..9aab1b346d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,6 +82,26 @@ cmake_dependent_option(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSV
option(ENABLE_DEBUG_TOOLS "Enable debugging tools (maxwell disassembler, SPIRV translator, etc)" OFF)
option(ENABLE_WERROR "Enable -Werror diagnostics" ON)
+# Handle specific -Werror downgrades safely across platforms
+if(ENABLE_WERROR)
+ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ if(CMAKE_C_FLAGS MATCHES "-Werror=unused")
+ string(REPLACE "-Werror=unused" "-Wno-error=unused" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+ endif()
+ if(CMAKE_CXX_FLAGS MATCHES "-Werror=unused")
+ string(REPLACE "-Werror=unused" "-Wno-error=unused" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ endif()
+
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=unused -Wno-error=unused-function")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused -Wno-error=unused-function")
+ elseif(MSVC)
+ # Windows Specifically
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4100 /wd4101")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4100 /wd4101")
+ endif()
+endif()
+
+
# Lossless Scaling frame generation. Only Android.
option(ENABLE_LSFG "Enable frame generation (LSFG and FSR 3 Fluid Motion)" ON)