diff --git a/cmake/compile_definitions/common.cmake b/cmake/compile_definitions/common.cmake index f4a91a78..a2260595 100644 --- a/cmake/compile_definitions/common.cmake +++ b/cmake/compile_definitions/common.cmake @@ -6,12 +6,19 @@ list(APPEND SUNSHINE_COMPILE_OPTIONS -Wall -Wno-sign-compare) # Werror - treat warnings as errors # Wno-maybe-uninitialized/Wno-uninitialized - disable warnings for maybe uninitialized variables # Wno-sign-compare - disable warnings for signed/unsigned comparisons +# Wno-restrict - disable warnings for memory overlap if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # GCC specific compile options # GCC 12 and higher will complain about maybe-uninitialized if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12) list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-maybe-uninitialized) + + # Disable the bogus warning that may prevent compilation (only for GCC 12). + # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651. + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13) + list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-restrict) + endif() endif() elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # Clang specific compile options