build(linux): disable GCC 12 Wrestrict warning (#2925)
This commit is contained in:
@@ -6,12 +6,19 @@ list(APPEND SUNSHINE_COMPILE_OPTIONS -Wall -Wno-sign-compare)
|
|||||||
# Werror - treat warnings as errors
|
# Werror - treat warnings as errors
|
||||||
# Wno-maybe-uninitialized/Wno-uninitialized - disable warnings for maybe uninitialized variables
|
# Wno-maybe-uninitialized/Wno-uninitialized - disable warnings for maybe uninitialized variables
|
||||||
# Wno-sign-compare - disable warnings for signed/unsigned comparisons
|
# Wno-sign-compare - disable warnings for signed/unsigned comparisons
|
||||||
|
# Wno-restrict - disable warnings for memory overlap
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
# GCC specific compile options
|
# GCC specific compile options
|
||||||
|
|
||||||
# GCC 12 and higher will complain about maybe-uninitialized
|
# GCC 12 and higher will complain about maybe-uninitialized
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
|
||||||
list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-maybe-uninitialized)
|
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()
|
endif()
|
||||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
# Clang specific compile options
|
# Clang specific compile options
|
||||||
|
|||||||
Reference in New Issue
Block a user