From 0ff7ea3ccc9e888607f89ba322c5a5e9500d1210 Mon Sep 17 00:00:00 2001 From: Shanoah Alkire Date: Sun, 9 Dec 2018 02:35:49 -0800 Subject: [PATCH] Only use -Wno-class-memaccess on gcc 8.0 or higher, as it didn't exist previously. --- pcsx2/CMakeLists.txt | 14 +++++++++++--- plugins/GSdx/CMakeLists.txt | 14 ++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 68249e5010..edf0b12a95 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -18,13 +18,21 @@ set(CommonFlags -Wstrict-aliasing # Allow to track strict aliasing issue. -Wno-char-subscripts # only impact svu which is deprecated -Wno-missing-braces - # Largely turning off because LegacyPluginAPI_Common in Plugins.h spams really badly in gcc 8 due to the memzero initialization. - # Should probably be fixed properly, but for now this should work. - -Wno-class-memaccess #-Wno-ignored-attributes # don't remember why I put here but it is pure C option, therefore it complains for nothings on cpp files -DWX_PRECOMP ) +# Largely turning off because LegacyPluginAPI_Common in Plugins.h spams really badly in gcc 8 due to the memzero initialization. +# Should probably be fixed properly, but for now this should work. +if(GCC_VERSION VERSION_EQUAL "8.0" OR GCC_VERSION VERSION_GREATER "8.0") + set(CommonFlags + ${CommonFlags} + -Wno-class-memaccess + ) +endif() + + + if ("${PGO}" STREQUAL "generate") set(pcsx2FinalFlags -fprofile-generate) elseif("${PGO}" STREQUAL "use") diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt index 069157edb7..a26b52d16e 100644 --- a/plugins/GSdx/CMakeLists.txt +++ b/plugins/GSdx/CMakeLists.txt @@ -14,12 +14,18 @@ set(CommonFlags -Wno-unknown-pragmas -Wno-parentheses -Wunused-variable # __dummy variable need to be investigated - # The next two need to be looked at, but spam really badly in gcc 8. - # Largely class alignment in GSDevice.h and memcpy in GSVector*.h. - -Wno-class-memaccess - -Wno-packed-not-aligned ) +# The next two need to be looked at, but spam really badly in gcc 8. +# Largely class alignment in GSDevice.h and memcpy in GSVector*.h. +if(GCC_VERSION VERSION_EQUAL "8.0" OR GCC_VERSION VERSION_GREATER "8.0") + set(CommonFlags + ${CommonFlags} + -Wno-class-memaccess + -Wno-packed-not-aligned + ) +endif() + if(USE_ICC) set(CommonFlags "${CommonFlags} -restrict") endif()