|
2 | 2 | <!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. --> |
3 | 3 | <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
4 | 4 |
|
5 | | - <Target Name="WindowsAppRuntimeAutoInitializer"> |
6 | | - <PropertyGroup> |
7 | | - <WindowsAppRuntimeAutoInitializerPath>$(MSBuildThisFileDirectory)..\..\include\WindowsAppRuntimeAutoInitializer.cpp</WindowsAppRuntimeAutoInitializerPath> |
8 | | - <WindowsAppRuntimeAutoInitializerDefines /> |
9 | | - <WindowsAppRuntimeAutoInitializerDefines Condition="'$(WindowsAppSdkBootstrapInitialize)'=='true'">$(WindowsAppRuntimeAutoInitializerDefines);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP</WindowsAppRuntimeAutoInitializerDefines> |
10 | | - <WindowsAppRuntimeAutoInitializerDefines Condition="'$(WindowsAppSdkDeploymentManagerInitialize)'=='true'">$(WindowsAppRuntimeAutoInitializerDefines);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER</WindowsAppRuntimeAutoInitializerDefines> |
11 | | - <WindowsAppRuntimeAutoInitializerDefines Condition="'$(WindowsAppSdkUndockedRegFreeWinRTInitialize)'=='true'">$(WindowsAppRuntimeAutoInitializerDefines);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT</WindowsAppRuntimeAutoInitializerDefines> |
12 | | - <WindowsAppRuntimeAutoInitializerDefines Condition="'$(WindowsAppSdkCompatibilityInitialize)'=='true'">$(WindowsAppRuntimeAutoInitializerDefines);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY</WindowsAppRuntimeAutoInitializerDefines> |
13 | | - </PropertyGroup> |
| 5 | + <PropertyGroup> |
| 6 | + <WindowsAppRuntimeAutoInitializerPath>$(MSBuildThisFileDirectory)..\..\include\WindowsAppRuntimeAutoInitializer.cpp</WindowsAppRuntimeAutoInitializerPath> |
14 | 7 |
|
15 | | - <!-- |
16 | | - Add a ClCompile for the 'WindowsAppRuntimeAutoInitializer'. This is done in two steps; |
17 | | - 1. Add the ClCompile item with no metadata, so the default metadata is applied. |
18 | | - 2. Add a second ClCompile item that uses the %(Identity) metadata to force a 'task batch' with just the one item |
19 | | - we want to modify. This allows us to use "%(PreprocessorDefinitions)" (without causing more task batching) to |
20 | | - append the PreprocessorDefinitions to apply. |
21 | | - --> |
22 | | - <ItemGroup> |
23 | | - <ClCompile Include="$(WindowsAppRuntimeAutoInitializerPath)" /> |
24 | | - <ClCompile Condition=" '%(Identity)' == '$(WindowsAppRuntimeAutoInitializerPath)' "> |
25 | | - <PrecompiledHeader>NotUsing</PrecompiledHeader> |
26 | | - <PreprocessorDefinitions>$(WindowsAppRuntimeAutoInitializerDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions> |
27 | | - </ClCompile> |
28 | | - </ItemGroup> |
29 | | - </Target> |
| 8 | + <!-- If any option is set that needs to add a preprocessor definition, enable 'WindowsAppRuntimeAutoInitializerEnabled' --> |
| 9 | + <WindowsAppRuntimeAutoInitializerEnabled Condition="'$(WindowsAppSdkBootstrapInitialize)'=='true'">true</WindowsAppRuntimeAutoInitializerEnabled> |
| 10 | + <WindowsAppRuntimeAutoInitializerEnabled Condition="'$(WindowsAppSdkDeploymentManagerInitialize)'=='true'">true</WindowsAppRuntimeAutoInitializerEnabled> |
| 11 | + <WindowsAppRuntimeAutoInitializerEnabled Condition="'$(WindowsAppSdkUndockedRegFreeWinRTInitialize)'=='true'">true</WindowsAppRuntimeAutoInitializerEnabled> |
| 12 | + <WindowsAppRuntimeAutoInitializerEnabled Condition="'$(WindowsAppSdkCompatibilityInitialize)'=='true'">true</WindowsAppRuntimeAutoInitializerEnabled> |
| 13 | + |
| 14 | + <!-- If no options are set that require the auto-initializer, and a consumer hasn't explicitly set it, default to 'false' --> |
| 15 | + <WindowsAppRuntimeAutoInitializerEnabled Condition="'$(WindowsAppRuntimeAutoInitializerEnabled)'==''">false</WindowsAppRuntimeAutoInitializerEnabled> |
| 16 | + </PropertyGroup> |
30 | 17 |
|
31 | 18 | <PropertyGroup> |
32 | 19 | <BeforeClCompileTargets> |
33 | 20 | $(BeforeClCompileTargets); WindowsAppRuntimeAutoInitializer; |
34 | 21 | </BeforeClCompileTargets> |
35 | 22 | </PropertyGroup> |
36 | 23 |
|
| 24 | + <ItemDefinitionGroup> |
| 25 | + <!-- Add the appropriate definition to the ClCompile ItemDefinitionGroup to apply to all compilations --> |
| 26 | + <ClCompile> |
| 27 | + <PreprocessorDefinitions Condition="'$(WindowsAppSdkBootstrapInitialize)'=='true'">MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 28 | + <PreprocessorDefinitions Condition="'$(WindowsAppSdkDeploymentManagerInitialize)'=='true'">MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 29 | + <PreprocessorDefinitions Condition="'$(WindowsAppSdkUndockedRegFreeWinRTInitialize)'=='true'">MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 30 | + <PreprocessorDefinitions Condition="'$(WindowsAppSdkCompatibilityInitialize)'=='true'">MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 31 | + </ClCompile> |
| 32 | + </ItemDefinitionGroup> |
| 33 | + |
| 34 | + <!-- If WindowsAppRuntimeAutoInitializerEnabled is true add a Target to add the WindowsAppRuntimeAutoInitializer.cpp file --> |
| 35 | + <Target Name="WindowsAppRuntimeAutoInitializer" Condition=" '$(WindowsAppRuntimeAutoInitializerEnabled)'=='true' "> |
| 36 | + <ItemGroup> |
| 37 | + <ClCompile Include="$(WindowsAppRuntimeAutoInitializerPath)"> |
| 38 | + <PrecompiledHeader>NotUsing</PrecompiledHeader> |
| 39 | + </ClCompile> |
| 40 | + </ItemGroup> |
| 41 | + </Target> |
| 42 | + |
37 | 43 | </Project> |
0 commit comments