From d6c9831efd624a7a5a9dc47df6c73f5d4b556ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C3=ABl=20Kooi?= <48814281+RA-Kooi@users.noreply.github.com> Date: Mon, 27 Dec 2021 14:08:07 +0100 Subject: [PATCH] DolphinQt: Fix generation of /external:I flags Mainly concerns to building with Ninja, as that's what I tested it with. Originally it would only prepend the first path with `/external:I`, however all paths in the list have to be prepended with `/external:I`. The MS documentation seems to support this, as it makes no mention of it accepting a list. This is probably the worst way to implement this, I am unfamiliar with CMake. --- Source/Core/DolphinQt/CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index ec854d5d42..8ac837541d 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -369,8 +369,15 @@ if (MSVC) # 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}") + set(qtGui "") + set(qtGuiPriv "") + set(qtWidgetsPriv "") + list(TRANSFORM Qt5Gui_INCLUDE_DIRS PREPEND "/external:I" OUTPUT_VARIABLE qtGui) + list(TRANSFORM Qt5Gui_PRIVATE_INCLUDE_DIRS PREPEND "/external:I" OUTPUT_VARIABLE qtGuiPriv) + list(TRANSFORM Qt5Widgets_PRIVATE_INCLUDE_DIRS PREPEND "/external:I" OUTPUT_VARIABLE qtWidgetsPriv) + target_compile_options(dolphin-emu PRIVATE "${qtGui}") + target_compile_options(dolphin-emu PRIVATE "${qtGuiPriv}") + target_compile_options(dolphin-emu PRIVATE "${qtWidgets}") endif() if(WIN32)