CMake: Selectively enable -Werror for common sources of errors

This commit is contained in:
Tony Wasserka 2024-09-15 10:33:28 +02:00
parent c600e2d4c0
commit 3cb55e40d2
3 changed files with 7 additions and 0 deletions

View file

@ -24,6 +24,9 @@ endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_compile_options(-Werror=implicit-fallthrough)
add_compile_options(-Werror=return-type)
# Prefer Conan-provided packages over system ones
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)

View file

@ -90,6 +90,7 @@ inline std::ostream& operator<<(std::ostream& os, ShaderEngine engine) {
case ShaderEngine::GLSL:
return (os << "glsl");
}
return os;
}
}

View file

@ -53,3 +53,6 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# Required for g_vulkan_queue_mutex
target_link_options(video_core PRIVATE "-undefined;dynamic_lookup")
endif()
# Selectively disable Werror to cover false positives
target_compile_options(video_core PRIVATE -Wno-error=return-type)