From af559385380dfe2a5dc1f2d9f11d5c6deab2555b Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Fri, 21 Aug 2020 01:18:14 -0700 Subject: [PATCH] msbuild: use the moc dispatcher from Qt's vstools The new method supports build parallelism and cleaner integration into msbuild dependency flows. --- Source/Core/DolphinQt/DolphinQt.vcxproj | 399 +++----- Source/VSProps/QtCompile.props | 60 +- Source/VSProps/QtCompile.targets | 10 - Source/VSProps/qt_globals.targets | 558 ++++++++++++ Source/VSProps/qt_tasks.targets | 1110 +++++++++++++++++++++++ Source/VSProps/qtmoc.props | 83 ++ Source/VSProps/qtmoc.targets | 510 +++++++++++ Source/VSProps/qtmoc_cl.targets | 49 + 8 files changed, 2465 insertions(+), 314 deletions(-) delete mode 100644 Source/VSProps/QtCompile.targets create mode 100644 Source/VSProps/qt_globals.targets create mode 100644 Source/VSProps/qt_tasks.targets create mode 100644 Source/VSProps/qtmoc.props create mode 100644 Source/VSProps/qtmoc.targets create mode 100644 Source/VSProps/qtmoc_cl.targets diff --git a/Source/Core/DolphinQt/DolphinQt.vcxproj b/Source/Core/DolphinQt/DolphinQt.vcxproj index 8e29973648..89ecbafd2e 100644 --- a/Source/Core/DolphinQt/DolphinQt.vcxproj +++ b/Source/Core/DolphinQt/DolphinQt.vcxproj @@ -21,7 +21,6 @@ 5054;%(DisableSpecificWarnings) - ($ProjectDir)Config\Graphics;%(AdditionalIncludeDirectories) $(ProjectDir)Config;%(AdditionalIncludeDirectories) $(ProjectDir)Config\ControllerInterface;%(AdditionalIncludeDirectories) @@ -44,268 +43,7 @@ DolphinQt.manifest;%(AdditionalManifestFiles) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -442,7 +180,11 @@ - + @@ -455,6 +197,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -531,9 +400,7 @@ - - - + diff --git a/Source/VSProps/QtCompile.props b/Source/VSProps/QtCompile.props index 6ee1546228..107f176795 100644 --- a/Source/VSProps/QtCompile.props +++ b/Source/VSProps/QtCompile.props @@ -1,5 +1,5 @@ - + $(ExternalsDir)Qt\Qt5.15.0\msvc2019_64\ $(ExternalsDir)Qt\Qt5.15.0\msvc2019_arm64\ @@ -12,7 +12,6 @@ $(QTDIR)bin\ $(QTDIR)plugins\ $(IntDir) - $(QtToolOutDir)moc_ d $(QtDebugSuffix) QtPlugins @@ -22,7 +21,6 @@ QT_NO_DEBUG;%(PreprocessorDefinitions) QT_DLL;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions) QT_USE_QSTRINGBUILDER;QT_NO_CAST_FROM_ASCII;QT_NO_CAST_TO_ASCII;%(PreprocessorDefinitions) - $(ProjectDir);%(AdditionalIncludeDirectories) $(QtToolOutDir);%(AdditionalIncludeDirectories) $(QtIncludeDir);%(AdditionalIncludeDirectories) $(QtIncludeDir)QtCore;%(AdditionalIncludeDirectories) @@ -45,46 +43,32 @@ - - - - -DQT_USE_QSTRINGBUILDER -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -D_SECURE_SCL=0 -D_ARCH_64=1 -D_M_X86_64=1 -D_M_X86=1 -DUSE_UPNP -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_UNICODE -DUNICODE - -DQT_NO_DEBUG -DNDEBUG $(MocDefines) - - "-I$(QtIncludeDir)QtWidgets" "-I$(QtIncludeDir)QtGui" "-I$(QtIncludeDir)QtCore" "-I$(QtIncludeDir) " "-I$(QtToolOutDir) " -I. - "-I$(ExternalsDir)xxhash" "-I$(ExternalsDir)zlib" "-I$(ExternalsDir)SFML\include" "-I$(ExternalsDir)mbedtls\include" "-I$(ExternalsDir)miniupnpc\src" "-I$(ExternalsDir)LZO" "-I$(ExternalsDir)libusbx\libusb" "-I$(ExternalsDir)libpng" "-I$(ExternalsDir)GL" "-I$(ExternalsDir)Bochs_disasm" "-I$(CoreDir) " $(MocIncludes) - - - - - - - - - - - - - + + + + + $(QtToolOutDir)moc_%(Filename).cpp + $(QtToolOutDir) + + + + + + + - - QtMoc - diff --git a/Source/VSProps/QtCompile.targets b/Source/VSProps/QtCompile.targets deleted file mode 100644 index bd437e7c34..0000000000 --- a/Source/VSProps/QtCompile.targets +++ /dev/null @@ -1,10 +0,0 @@ - - - - QtMocClean;$(CleanDependsOn) - - - \ No newline at end of file diff --git a/Source/VSProps/qt_globals.targets b/Source/VSProps/qt_globals.targets new file mode 100644 index 0000000000..8b6eb23dbc --- /dev/null +++ b/Source/VSProps/qt_globals.targets @@ -0,0 +1,558 @@ + + + + + + + + + + QtVersion; + $(BuildDependsOn); + Qt + + + $(CleanDependsOn); + QtClean + + + $(DesignTimeBuildInitTargets); + Qt + + + $(ComputeCompileInputsTargets); + Qt + + + $(BeforeClCompileTargets); + Qt + + + $(ComputeLinkInputsTargets); + Qt + + + + + + + $(QtVSToolsVersion) + false + $([System.IO.Path]::Combine($(ProjectDir),$(IntDir)qt_work.log)) + $([System.Environment]::ProcessorCount) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $([System.String]::Copy('%(QtLogData.Identity)').Split('|')[1]) + + + + + + + + + + + + + + + + + @(QtWork->'%(WorkType)(%(Identity))') + @(QtWork->'%(DependenciesChanged)') + @(QtWork->'%(InputChanged)') + true + + + + + + + + @(log_entry->'%(Hash)') + + + + + true + true + + + + + + 0 + true + + + + + + + + + $(work_hash) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + InputPath + %(QtWork.Identity) + %(QtWork.Identity) + + + InputPath + @(ResourceFiles->'%(Value)') + @(ResourceFiles->'%(Value)') + + + OutputPath + %(QtWork.OutputFile) + %(QtWork.OutputFile) + + + + + + + + + + + + + + + + + + 0 + + + + + + + %(QtWorkResult.WorkType) + + + %(Identity) + $([System.IO.Path]::Combine('$(MSBuildProjectDirectory)','%(Identity)')) + + + + + + + + + %(QtWorkResult.WorkType) + + + %(Identity) + $([System.IO.Path]::Combine('$(MSBuildProjectDirectory)','%(Identity)')) + + + + + + + + + @(QtWorkResult, '|') + + + + + + + + + + + + + + + + + + + $(IntDir)%(Filename).o + + + + + + + + + + + + $(ProjectDir);%(AdditionalIncludeDirectories) + %(PrecompiledHeaderFile) + + + + + + + + + + + + + @(QtWorkResult->'%(ClCompile)') + + + $(SelectedFiles);$(SelectedClCompile) + + + + + + + + @(QtIncludePath->Distinct()) + + + + $(QtIncludePath);%(ClCompile.AdditionalIncludeDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(QtOuterBuildPrepare);QtOuterBuild;$(QtOuterBuildFinalize) + $(MSBuildProjectFullPath) + $([System.IO.Path]::GetRandomFileName()) + + + + + $(QtOuterBuildPrepare);$(QtOuterBuildFinalize) + + + diff --git a/Source/VSProps/qt_tasks.targets b/Source/VSProps/qt_tasks.targets new file mode 100644 index 0000000000..7f4a8e155e --- /dev/null +++ b/Source/VSProps/qt_tasks.targets @@ -0,0 +1,1110 @@ + + + + + + + + + + + + + + + + + + files = qrc + .Element("RCC") + .Elements("qresource") + .Elements("file"); + Uri QrcPath = new Uri(QrcFilePath); + Result = files + .Select(x => new Uri(QrcPath, x.Value).LocalPath) + .ToArray(); + ]]> + + + + + + + + + + + + + + + + + + x) + .Select(x => string.Format("[{0}={1}]", x, Item.GetMetadata(x)))) + .ToUpper()); + using (var dataZipped = new MemoryStream()) { + using (var zip = new DeflateStream(dataZipped, CompressionLevel.Fastest)) + zip.Write(data, 0, data.Length); + Hash = Convert.ToBase64String(dataZipped.ToArray()); + } + ]]> + + + + + + + + + +