Skip to content

Commit 2cf5564

Browse files
authored
Improve shared props layout (#5751)
## Change Implement @florelis suggestion from #5749.
1 parent 7445e1d commit 2cf5564

File tree

1 file changed

+13
-43
lines changed

1 file changed

+13
-43
lines changed

src/Directory.Build.props

Lines changed: 13 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,24 @@
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<!-- Consume containing solution build props if present. -->
44
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" Condition="'' != $([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
5-
6-
<ItemDefinitionGroup Condition="'$(UseProdCLSIDs)'=='true'">
7-
<ClCompile>
8-
<PreprocessorDefinitions>USE_PROD_CLSIDS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
9-
</ClCompile>
10-
</ItemDefinitionGroup>
11-
12-
<PropertyGroup Condition="'$(UseProdCLSIDs)'=='true'">
13-
<DefineConstants>$(DefineConstants);USE_PROD_CLSIDS</DefineConstants>
14-
</PropertyGroup>
15-
16-
<ItemDefinitionGroup Condition="'$(WingetDisableTestHooks)'=='true'">
17-
<ClCompile>
18-
<PreprocessorDefinitions>AICLI_DISABLE_TEST_HOOKS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
19-
</ClCompile>
20-
</ItemDefinitionGroup>
21-
22-
<PropertyGroup Condition="'$(WingetDisableTestHooks)'=='true'">
23-
<DefineConstants>$(DefineConstants);AICLI_DISABLE_TEST_HOOKS</DefineConstants>
24-
</PropertyGroup>
25-
26-
<ItemDefinitionGroup Condition="'$(WingetDisableExperimentalFeatures)'=='true'">
27-
<ClCompile>
28-
<PreprocessorDefinitions>WINGET_DISABLE_EXPERIMENTAL_FEATURES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
29-
</ClCompile>
30-
</ItemDefinitionGroup>
315

32-
<PropertyGroup Condition="'$(WingetDisableExperimentalFeatures)'=='true'">
33-
<DefineConstants>$(DefineConstants);WINGET_DISABLE_EXPERIMENTAL_FEATURES</DefineConstants>
6+
<PropertyGroup>
7+
<WinGetMacros Condition="'$(UseProdCLSIDs)' == 'true'">USE_PROD_CLSIDS;$(WinGetMacros)</WinGetMacros>
8+
<WinGetMacros Condition="'$(WingetDisableTestHooks)' == 'true'">AICLI_DISABLE_TEST_HOOKS;$(WinGetMacros)</WinGetMacros>
9+
<WinGetMacros Condition="'$(WingetDisableExperimentalFeatures)' == 'true'">WINGET_DISABLE_EXPERIMENTAL_FEATURES;$(WinGetMacros)</WinGetMacros>
10+
<WinGetMacros Condition="'$(UseProdWingetServer)' == 'true'">USE_PROD_WINGET_SERVER;$(WinGetMacros)</WinGetMacros>
11+
<WinGetMacros Condition="'$(WingetEnableReleaseBuild)' == 'true'">WINGET_ENABLE_RELEASE_BUILD;$(WinGetMacros)</WinGetMacros>
3412
</PropertyGroup>
3513

36-
<ItemDefinitionGroup Condition="'$(UseProdWingetServer)'=='true'">
37-
<ClCompile>
38-
<PreprocessorDefinitions>USE_PROD_WINGET_SERVER;%(PreprocessorDefinitions)</PreprocessorDefinitions>
39-
</ClCompile>
40-
</ItemDefinitionGroup>
41-
42-
<PropertyGroup Condition="'$(UseProdWingetServer)'=='true'">
43-
<DefineConstants>$(DefineConstants);USE_PROD_WINGET_SERVER</DefineConstants>
44-
</PropertyGroup>
45-
46-
<ItemDefinitionGroup Condition="'$(WingetEnableReleaseBuild)'=='true'">
14+
<!-- For C++ -->
15+
<ItemDefinitionGroup Condition="'$(WinGetMacros)' != ''">
4716
<ClCompile>
48-
<PreprocessorDefinitions>WINGET_ENABLE_RELEASE_BUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
17+
<PreprocessorDefinitions>$(WinGetMacros)%(PreprocessorDefinitions)</PreprocessorDefinitions>
4918
</ClCompile>
5019
</ItemDefinitionGroup>
5120

52-
<PropertyGroup Condition="'$(WingetEnableReleaseBuild)'=='true'">
53-
<DefineConstants>$(DefineConstants);WINGET_ENABLE_RELEASE_BUILD</DefineConstants>
21+
<!-- For C# -->
22+
<PropertyGroup Condition="'$(WinGetMacros)' != ''">
23+
<DefineConstants>$(WinGetMacros)$(DefineConstants)</DefineConstants>
5424
</PropertyGroup>
55-
</Project>
25+
</Project>

0 commit comments

Comments
 (0)