From 05b1566e3f8febbf94827899214ad8a135797bd2 Mon Sep 17 00:00:00 2001 From: iwubcode Date: Sat, 15 May 2021 13:32:56 -0500 Subject: [PATCH 1/3] DolphinQt: don't propagate warnings in the header to Dolphin when building with Visual Studio through CMake --- Source/Core/DolphinQt/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index 13c9a3d79a..288e313e3f 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -350,10 +350,11 @@ if (WIN32) endif() if (MSVC) - # Disable some warnings - - # 5054: operator '+': deprecated between enumerations of different types (in Qt headers) - target_compile_options(dolphin-emu PRIVATE /wd5054) + # Don't propogate warnings in qt headers to Dolphin + target_compile_options(dolphin-emu PRIVATE /experimental:external) + target_compile_options(dolphin-emu PRIVATE /external:W0) + target_compile_options(dolphin-emu PRIVATE "/external:I${Qt5Gui_PRIVATE_INCLUDE_DIRS}") + target_compile_options(dolphin-emu PRIVATE "/external:I${Qt5Widgets_PRIVATE_INCLUDE_DIRS}") endif() if(WIN32) From 04a635e884024b24e0c86c473a81891dc9566d54 Mon Sep 17 00:00:00 2001 From: iwubcode Date: Sat, 15 May 2021 14:07:16 -0500 Subject: [PATCH 2/3] DolphinQt: fix Visual Studio warning about 'assignment within conditional expression' --- Source/Core/DolphinQt/QtUtils/FlowLayout.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt/QtUtils/FlowLayout.cpp b/Source/Core/DolphinQt/QtUtils/FlowLayout.cpp index e986f2f382..c1e4fefe11 100644 --- a/Source/Core/DolphinQt/QtUtils/FlowLayout.cpp +++ b/Source/Core/DolphinQt/QtUtils/FlowLayout.cpp @@ -66,8 +66,7 @@ FlowLayout::FlowLayout(int margin, int h_spacing, int v_spacing) FlowLayout::~FlowLayout() { - QLayoutItem* item; - while ((item = takeAt(0))) + while (QLayoutItem* item = takeAt(0)) delete item; } From 99a724361abb5c9728761dfc13b9f58a0b4fff8b Mon Sep 17 00:00:00 2001 From: iwubcode Date: Sat, 15 May 2021 14:08:21 -0500 Subject: [PATCH 3/3] DolphinQt: update visual studio qt props to ignore warnings in headers --- Source/VSProps/QtCompile.props | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/VSProps/QtCompile.props b/Source/VSProps/QtCompile.props index 0ad24e61ad..60e4b32939 100644 --- a/Source/VSProps/QtCompile.props +++ b/Source/VSProps/QtCompile.props @@ -28,10 +28,11 @@ $(QtIncludeDir)QtWidgets;%(AdditionalIncludeDirectories) $(QtIncludeDir)QtANGLE;%(AdditionalIncludeDirectories) - %(AdditionalOptions) /wd4946 + %(AdditionalOptions) /experimental:external + %(AdditionalOptions) /external:W0 + %(AdditionalOptions) /external:I$(QtIncludeDir) $(QtLibDir);%(AdditionalLibraryDirectories)