Skip to content

Commit

Permalink
Add auto initializer targets via BeforeClCompileTargets to get better…
Browse files Browse the repository at this point in the history
… timing for picking up added compiler options. (#5003)
  • Loading branch information
codendone authored Jan 4, 2025
1 parent 5a99438 commit 430b3a2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
8 changes: 7 additions & 1 deletion build/NuSpecs/WindowsAppSDK-Nuget-Native.Bootstrap.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Target Name="GenerateBootstrapCpp" BeforeTargets="ClCompile">
<Target Name="GenerateBootstrapCpp">
<ItemGroup>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\include\MddBootstrapAutoInitializer.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
Expand All @@ -15,4 +15,10 @@
</ItemGroup>
</Target>

<PropertyGroup>
<BeforeClCompileTargets>
$(BeforeClCompileTargets); GenerateBootstrapCpp;
</BeforeClCompileTargets>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Target Name="GenerateDeploymentManagerCpp" BeforeTargets="ClCompile">
<Target Name="GenerateDeploymentManagerCpp">
<ItemGroup>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\include\DeploymentManagerAutoInitializer.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
Expand All @@ -11,4 +11,10 @@
</ItemGroup>
</Target>

<PropertyGroup>
<BeforeClCompileTargets>
$(BeforeClCompileTargets); GenerateDeploymentManagerCpp;
</BeforeClCompileTargets>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Target Name="GenerateUndockedRegFreeWinRTCpp" BeforeTargets="ClCompile" Condition="'$(WindowsAppSdkUndockedRegFreeWinRTInitialize)' == 'true'">
<Target Name="AddUndockedRegFreeWinRTCppDefines" BeforeTargets="ClCompile" Condition="'$(WindowsAppSdkUndockedRegFreeWinRTInitialize)' == 'true'">
<ItemGroup>
<ClCompile>
<PreprocessorDefinitions>MICROSOFT_WINDOWSAPPSDK_UNDOCKEDREGFREEWINRT_AUTO_INITIALIZE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(WindowsAppSdkUndockedRegFreeWinRTInitializeLoadLibrary)' == 'true'">MICROSOFT_WINDOWSAPPSDK_UNDOCKEDREGFREEWINRT_AUTO_INITIALIZE_LOADLIBRARY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemGroup>
</Target>

<Target Name="GenerateUndockedRegFreeWinRTCpp" Condition="'$(WindowsAppSdkUndockedRegFreeWinRTInitialize)' == 'true'">
<ItemGroup>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\include\UndockedRegFreeWinRT-AutoInitializer.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PreprocessorDefinitions>MICROSOFT_WINDOWSAPPSDK_UNDOCKEDREGFREEWINRT_AUTO_INITIALIZE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand All @@ -14,4 +19,10 @@
</ItemGroup>
</Target>

<PropertyGroup>
<BeforeClCompileTargets>
$(BeforeClCompileTargets); GenerateUndockedRegFreeWinRTCpp;
</BeforeClCompileTargets>
</PropertyGroup>

</Project>

0 comments on commit 430b3a2

Please sign in to comment.