From 7a29e6a6bbb64b5261ddfb1e024c2faa67483ec0 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 18 Mar 2022 13:20:14 +0000 Subject: [PATCH] Add a fallback path to manually get git commit on VS2022 * Loading LibGit2Sharp.dll by hand in msbuild no longer works in VS2022 due to architecture changes. We can fairly reliably get the same result by manually reading (and following the ref in) .git/HEAD --- renderdoc/renderdoc_version.vcxproj | 74 ++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 7 deletions(-) diff --git a/renderdoc/renderdoc_version.vcxproj b/renderdoc/renderdoc_version.vcxproj index 0dec255a9..f41b6f668 100644 --- a/renderdoc/renderdoc_version.vcxproj +++ b/renderdoc/renderdoc_version.vcxproj @@ -66,9 +66,13 @@ $([MSBuild]::Unescape("$(DevEnvDir)\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\LibGit2Sharp.dll")) $([MSBuild]::Unescape("$(VSInstallDir)\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\LibGit2Sharp.dll")) + + + + - + @@ -77,14 +81,15 @@ + { if (args.Name.Contains("LibGit2Sharp")) { return System.Reflection.Assembly.LoadFrom(LibGit2SharpAssemblyPath); } @@ -105,16 +110,71 @@ namespace GitIntrospection { [Microsoft.Build.Framework.Output] public string Sha1 { get; set; } } } +]]> + + + + + + + + + + + true - - + + - - + + + + + + GIT_COMMIT_HASH="$(CommitId)";%(PreprocessorDefinitions) + + + + + + + + + + GIT_COMMIT_HASH="$(CommitId)";%(PreprocessorDefinitions)