From 9e2b5164ff301921ab1db251babdc9d5ee1e9e25 Mon Sep 17 00:00:00 2001 From: David Raygoza Date: Thu, 29 Feb 2024 14:46:09 -0800 Subject: [PATCH 1/5] Make gtest projects Vulkan ready --- GoogleTestNuGet/Build.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GoogleTestNuGet/Build.ps1 b/GoogleTestNuGet/Build.ps1 index fbc2c56a..cfbe91f4 100644 --- a/GoogleTestNuGet/Build.ps1 +++ b/GoogleTestNuGet/Build.ps1 @@ -206,10 +206,10 @@ function Build-Binaries { Add-Signing -Directory $Dir -ProjectName "gtest" Add-Signing -Directory $Dir -ProjectName "gtest_main" - Invoke-Executable msbuild @("gtest.vcxproj", "/p:Configuration=Debug") - Invoke-Executable msbuild @("gtest_main.vcxproj", "/p:Configuration=Debug") - Invoke-Executable msbuild @("gtest.vcxproj", "/p:Configuration=RelWithDebInfo") - Invoke-Executable msbuild @("gtest_main.vcxproj", "/p:Configuration=RelWithDebInfo") + Invoke-Executable msbuild @("gtest.vcxproj", "/Zi /p:Configuration=Debug") + Invoke-Executable msbuild @("gtest_main.vcxproj", "/Zi /p:Configuration=Debug") + Invoke-Executable msbuild @("gtest.vcxproj", "/Zi /p:Configuration=RelWithDebInfo") + Invoke-Executable msbuild @("gtest_main.vcxproj", "/Zi /p:Configuration=RelWithDebInfo") } finally { Pop-Location } From 5785cc909c5dbd3b841bad891cb826ef812b6a1c Mon Sep 17 00:00:00 2001 From: Spencer Bloom Date: Thu, 29 Feb 2024 15:16:35 -0800 Subject: [PATCH 2/5] Add Linker options for gtest binaries --- GoogleTestNuGet/Build.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GoogleTestNuGet/Build.ps1 b/GoogleTestNuGet/Build.ps1 index cfbe91f4..0361cad5 100644 --- a/GoogleTestNuGet/Build.ps1 +++ b/GoogleTestNuGet/Build.ps1 @@ -134,6 +134,13 @@ function Add-Signing { $MicroBuildProps.SetAttribute("Project", "$microbuild\build\Microsoft.VisualStudioEng.MicroBuild.Core.props") $MicroBuildProps.SetAttribute("Condition", "Exists('$microbuild\build\Microsoft.VisualStudioEng.MicroBuild.Core.props')") + $LinkerGroup = $xml.CreateElement("ItemGroup", "http://schemas.microsoft.com/developer/msbuild/2003") + $Link = $xml.CreateElement("Link", "http://schemas.microsoft.com/developer/msbuild/2003") + $Profile = $xml.CreateElement("Profile", "http://schemas.microsoft.com/developer/msbuild/2003") + $Profile.set_InnerXML("true"); + $Link.AppendChild($Profile) | Out-Null + $LinkerGroup.AppendChild($Link) | Out-Null + $RealSignGroup = $xml.CreateElement("PropertyGroup", "http://schemas.microsoft.com/developer/msbuild/2003") $RealSignGroup.SetAttribute("Condition", "'`$(RealSign)' == 'True'") $SignAsm = $xml.CreateElement("SignAssembly", "http://schemas.microsoft.com/developer/msbuild/2003") @@ -170,6 +177,7 @@ function Add-Signing { $MicroBuildTargets.SetAttribute("Condition", "Exists('$microbuild\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets')") $xml.Project.AppendChild($MicroBuildProps) | Out-Null + $xml.Project.AppendChild($LinkerGroup) | Out-Null $xml.Project.AppendChild($RealSignGroup) | Out-Null $xml.Project.AppendChild($FileSignGroup) | Out-Null $xml.Project.AppendChild($MicroBuildTargets) | Out-Null From 149e497b0b73e0c31f471a90b27258321c863a02 Mon Sep 17 00:00:00 2001 From: Spencer Bloom Date: Thu, 29 Feb 2024 15:56:15 -0800 Subject: [PATCH 3/5] Move cl flag to project option and log project contents after modifications --- GoogleTestNuGet/Build.ps1 | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/GoogleTestNuGet/Build.ps1 b/GoogleTestNuGet/Build.ps1 index 0361cad5..3591c54b 100644 --- a/GoogleTestNuGet/Build.ps1 +++ b/GoogleTestNuGet/Build.ps1 @@ -134,12 +134,17 @@ function Add-Signing { $MicroBuildProps.SetAttribute("Project", "$microbuild\build\Microsoft.VisualStudioEng.MicroBuild.Core.props") $MicroBuildProps.SetAttribute("Condition", "Exists('$microbuild\build\Microsoft.VisualStudioEng.MicroBuild.Core.props')") - $LinkerGroup = $xml.CreateElement("ItemGroup", "http://schemas.microsoft.com/developer/msbuild/2003") + $BuildGroup = $xml.CreateElement("ItemGroup", "http://schemas.microsoft.com/developer/msbuild/2003") + $ClCompile = $xml.CreateElement("ClCompile", "http://schemas.microsoft.com/developer/msbuild/2003") + $AdditionalOptions = $xml.CreateElement("Profile", "http://schemas.microsoft.com/developer/msbuild/2003") + $AdditionalOptions.set_InnerXML("/Zi %(AdditionalOptions)"); + $ClCompile.AppendChild($AdditionalOptions) | Out-Null $Link = $xml.CreateElement("Link", "http://schemas.microsoft.com/developer/msbuild/2003") $Profile = $xml.CreateElement("Profile", "http://schemas.microsoft.com/developer/msbuild/2003") $Profile.set_InnerXML("true"); $Link.AppendChild($Profile) | Out-Null - $LinkerGroup.AppendChild($Link) | Out-Null + $BuildGroup.AppendChild($ClCompile) | Out-Null + $BuildGroup.AppendChild($Link) | Out-Null $RealSignGroup = $xml.CreateElement("PropertyGroup", "http://schemas.microsoft.com/developer/msbuild/2003") $RealSignGroup.SetAttribute("Condition", "'`$(RealSign)' == 'True'") @@ -177,12 +182,15 @@ function Add-Signing { $MicroBuildTargets.SetAttribute("Condition", "Exists('$microbuild\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets')") $xml.Project.AppendChild($MicroBuildProps) | Out-Null - $xml.Project.AppendChild($LinkerGroup) | Out-Null + $xml.Project.AppendChild($BuildGroup) | Out-Null $xml.Project.AppendChild($RealSignGroup) | Out-Null $xml.Project.AppendChild($FileSignGroup) | Out-Null $xml.Project.AppendChild($MicroBuildTargets) | Out-Null $xml.Save("$Directory\$ProjectName.vcxproj") + + #Print the contents of the project to validate the modifications + Get-Content "$Directory\$ProjectName.vcxproj" } function Build-Binaries { @@ -214,10 +222,10 @@ function Build-Binaries { Add-Signing -Directory $Dir -ProjectName "gtest" Add-Signing -Directory $Dir -ProjectName "gtest_main" - Invoke-Executable msbuild @("gtest.vcxproj", "/Zi /p:Configuration=Debug") - Invoke-Executable msbuild @("gtest_main.vcxproj", "/Zi /p:Configuration=Debug") - Invoke-Executable msbuild @("gtest.vcxproj", "/Zi /p:Configuration=RelWithDebInfo") - Invoke-Executable msbuild @("gtest_main.vcxproj", "/Zi /p:Configuration=RelWithDebInfo") + Invoke-Executable msbuild @("gtest.vcxproj", "/p:Configuration=Debug") + Invoke-Executable msbuild @("gtest_main.vcxproj", "/p:Configuration=Debug") + Invoke-Executable msbuild @("gtest.vcxproj", "/p:Configuration=RelWithDebInfo") + Invoke-Executable msbuild @("gtest_main.vcxproj", "/p:Configuration=RelWithDebInfo") } finally { Pop-Location } From 01f3785a1fe2b8e0e94e1a2fd3d37a4afd821395 Mon Sep 17 00:00:00 2001 From: Spencer Bloom Date: Thu, 29 Feb 2024 16:21:22 -0800 Subject: [PATCH 4/5] Change Item Group Type and try to fix logging modded projects --- GoogleTestNuGet/Build.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/GoogleTestNuGet/Build.ps1 b/GoogleTestNuGet/Build.ps1 index 3591c54b..d363fc40 100644 --- a/GoogleTestNuGet/Build.ps1 +++ b/GoogleTestNuGet/Build.ps1 @@ -134,7 +134,7 @@ function Add-Signing { $MicroBuildProps.SetAttribute("Project", "$microbuild\build\Microsoft.VisualStudioEng.MicroBuild.Core.props") $MicroBuildProps.SetAttribute("Condition", "Exists('$microbuild\build\Microsoft.VisualStudioEng.MicroBuild.Core.props')") - $BuildGroup = $xml.CreateElement("ItemGroup", "http://schemas.microsoft.com/developer/msbuild/2003") + $BuildGroup = $xml.CreateElement("ItemDefinitionGroup", "http://schemas.microsoft.com/developer/msbuild/2003") $ClCompile = $xml.CreateElement("ClCompile", "http://schemas.microsoft.com/developer/msbuild/2003") $AdditionalOptions = $xml.CreateElement("Profile", "http://schemas.microsoft.com/developer/msbuild/2003") $AdditionalOptions.set_InnerXML("/Zi %(AdditionalOptions)"); @@ -190,7 +190,10 @@ function Add-Signing { $xml.Save("$Directory\$ProjectName.vcxproj") #Print the contents of the project to validate the modifications - Get-Content "$Directory\$ProjectName.vcxproj" + Write-Host $xml + Write-Host "$Directory\$ProjectName.vcxproj" + Write-Output $xml + Write-Output "$Directory\$ProjectName.vcxproj" } function Build-Binaries { From e034ae84030f3928c991d77c9d11c2b1c0421b04 Mon Sep 17 00:00:00 2001 From: Spencer Bloom Date: Thu, 29 Feb 2024 16:58:05 -0800 Subject: [PATCH 5/5] Remove attempt at logging projects --- GoogleTestNuGet/Build.ps1 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/GoogleTestNuGet/Build.ps1 b/GoogleTestNuGet/Build.ps1 index d363fc40..c5bc2398 100644 --- a/GoogleTestNuGet/Build.ps1 +++ b/GoogleTestNuGet/Build.ps1 @@ -188,12 +188,6 @@ function Add-Signing { $xml.Project.AppendChild($MicroBuildTargets) | Out-Null $xml.Save("$Directory\$ProjectName.vcxproj") - - #Print the contents of the project to validate the modifications - Write-Host $xml - Write-Host "$Directory\$ProjectName.vcxproj" - Write-Output $xml - Write-Output "$Directory\$ProjectName.vcxproj" } function Build-Binaries {