Skip to content

Commit b3ba819

Browse files
committed
Add $ variable to ensure this only gets added if project is not ARM64
1 parent 6533169 commit b3ba819

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

GoogleTestAdapter/GoogleTestProjectTemplate/GoogleTest.vcxproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
4444
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
4545
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
46-
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
47-
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
46+
$arm64Pch$
4847
</ClCompile>
4948
</ItemGroup>
5049
<ItemDefinitionGroup />

GoogleTestAdapter/NewProjectWizard/WizardImplementation.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public class WizardImplementation : IWizard
2929
private const string ARM64ReleasePlatform = "$arm64releaseplatform$";
3030
private const string ARM64Config = "$arm64config$";
3131
private string arm64ConfigXML = "<ProjectConfiguration Include=\"Debug|ARM64\"> <Configuration>Debug</Configuration> <Platform>ARM64</Platform> </ProjectConfiguration> <ProjectConfiguration Include=\"Release|ARM64\"> <Configuration>Release</Configuration> <Platform>ARM64</Platform> </ProjectConfiguration>";
32+
private const string ARM64Pch = "$arm64Pch$";
33+
private string ARM64PchXML = "<PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">Create</PrecompiledHeader> <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">Create</PrecompiledHeader>";
3234
private List<Project> projects = new List<Project>();
3335
private int selectedProjectIndex;
3436
private IWizard nugetWizard;
@@ -150,21 +152,21 @@ public void RunStarted(object automationObject,
150152
}
151153

152154
string RuntimeDebugValue = "MultiThreadedDebugDLL";
153-
string RuntimeReleasevalue = "MultiThreadedDLL";
155+
string RuntimeReleaseValue = "MultiThreadedDLL";
154156
if (configurationData.IsRuntimeStatic)
155157
{
156-
RuntimeReleasevalue = "MultiThreaded";
158+
RuntimeReleaseValue = "MultiThreaded";
157159
RuntimeDebugValue = "MultiThreadedDebug";
158160
}
159161
else
160162
{
161-
RuntimeReleasevalue = "MultiThreadedDLL";
163+
RuntimeReleaseValue = "MultiThreadedDLL";
162164
RuntimeDebugValue = "MultiThreadedDebugDLL";
163165
}
164166

165167
string arm64DebugXMLChunk = $" <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\"> <ClCompile> <PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>ARM64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <RuntimeLibrary>{RuntimeDebugValue}</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> </ClCompile> <Link> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Console</SubSystem> </Link> </ItemDefinitionGroup>";
166-
string arm64ReleaseXMLChunk = $" <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\"> <ClCompile> <PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PreprocessorDefinitions>ARM64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>{RuntimeReleasevalue}</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Console</SubSystem> <OptimizeReferences>true</OptimizeReferences> <EnableCOMDATFolding>true</EnableCOMDATFolding> </Link> </ItemDefinitionGroup>";
167-
replacementsDictionary[RuntimeRelease] = RuntimeReleasevalue;
168+
string arm64ReleaseXMLChunk = $" <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\"> <ClCompile> <PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> <PreprocessorDefinitions>ARM64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>{RuntimeReleaseValue}</RuntimeLibrary> <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> <Link> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Console</SubSystem> <OptimizeReferences>true</OptimizeReferences> <EnableCOMDATFolding>true</EnableCOMDATFolding> </Link> </ItemDefinitionGroup>";
169+
replacementsDictionary[RuntimeRelease] = RuntimeReleaseValue;
168170
replacementsDictionary[RuntimeDebug] = RuntimeDebugValue;
169171

170172
if (!isPlatformSet)
@@ -192,8 +194,10 @@ public void RunStarted(object automationObject,
192194
arm64DebugXMLChunk = "";
193195
arm64ReleaseXMLChunk = "";
194196
arm64ConfigXML = "";
197+
ARM64PchXML = "";
195198
}
196199
replacementsDictionary[ARM64Config] = arm64ConfigXML;
200+
replacementsDictionary[ARM64Pch] = ARM64PchXML;
197201
replacementsDictionary[ARM64DebugPlatform] = arm64DebugXMLChunk;
198202
replacementsDictionary[ARM64ReleasePlatform] = arm64ReleaseXMLChunk;
199203

0 commit comments

Comments
 (0)