summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2022-09-14 23:01:00 +0200
committerGitHub <noreply@github.com>2022-09-14 23:01:00 +0200
commit1efb5b8800a4d12a94957c8469d2cd767cce318d (patch)
treeca9c0a7d05098ea6a12b3989b7daafb15eeabac0 /Source
parent09c07d4ff252b15b3a5431718cb410382550fc26 (diff)
parent84aa19db9679e3ab68fb248dd37e4b7a7236ab08 (diff)
Merge pull request #11063 from shuffle2/vcredist
windows: distribute vcredist loose files
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt/CMakeLists.txt22
-rw-r--r--Source/VSProps/Base.Dolphin.props12
2 files changed, 34 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt
index cd7e9def60..27e6eea689 100644
--- a/Source/Core/DolphinQt/CMakeLists.txt
+++ b/Source/Core/DolphinQt/CMakeLists.txt
@@ -440,6 +440,28 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf.win" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qt.conf"
)
+ # Copy VC++ Redist.
+ # NOTE This *intentionally* does not copy debug redist files.
+ # TODO This should really occur for any executable target.
+ # TODO Actually use cmake 'install' and InstallRequiredSystemLibraries.
+ if(MSVC_C_ARCHITECTURE_ID)
+ string(TOLOWER "${MSVC_C_ARCHITECTURE_ID}" CMAKE_MSVC_ARCH)
+ elseif(MSVC_CXX_ARCHITECTURE_ID)
+ string(TOLOWER "${MSVC_CXX_ARCHITECTURE_ID}" CMAKE_MSVC_ARCH)
+ else()
+ set(CMAKE_MSVC_ARCH x86)
+ endif()
+ set(MSVC_REDIST_NAME VC${MSVC_TOOLSET_VERSION})
+ find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT)
+ mark_as_advanced(MSVC_REDIST_DIR)
+ set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT")
+ file(GLOB MSVC_REDIST_DLLS "${MSVC_CRT_DIR}/*.dll")
+ foreach(MsvcRedistDll IN LISTS MSVC_REDIST_DLLS)
+ add_custom_command(TARGET dolphin-emu POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different "${MsvcRedistDll}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
+ )
+ endforeach()
+
# Delegate to Qt's official deployment binary on Windows to copy over the necessary Qt-specific libraries, etc.
get_target_property(MOC_EXECUTABLE_LOCATION Qt${QT_VERSION_MAJOR}::moc IMPORTED_LOCATION)
get_filename_component(QT_BINARY_DIRECTORY "${MOC_EXECUTABLE_LOCATION}" DIRECTORY)
diff --git a/Source/VSProps/Base.Dolphin.props b/Source/VSProps/Base.Dolphin.props
index 7f5c2a83d4..b8bf4f213a 100644
--- a/Source/VSProps/Base.Dolphin.props
+++ b/Source/VSProps/Base.Dolphin.props
@@ -84,4 +84,16 @@
<AdditionalOptions>/NODEFAULTLIB:msvcrt %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
+
+ <Target Name="CopyVCRedist" AfterTargets="Build" Condition="'$(ConfigurationType)'=='Application'">
+ <ItemGroup>
+ <VCRedistSourceFiles
+ Include="$(VCToolsRedistInstallDir)$(Platform)\Microsoft.VC$(PlatformToolsetVersion).CRT\*.dll" />
+ </ItemGroup>
+ <Copy
+ SourceFiles="@(VCRedistSourceFiles)"
+ DestinationFolder="$(BinaryOutputDir)"
+ SkipUnchangedFiles="true"
+ />
+ </Target>
</Project>