Skip to content

Commit 37b6121

Browse files
Build orchestration fixups (#2507)
* Include Microsoft.DotNet.Wpf.DncEng only when running CppHelper in RepoLocation=External. When RepoLocation=Internal, this package is not really needed. * Document FilterItem1ByItem2 task * Use /Z7 (i.e., oldStyle) when building dotnet-wpf-int repo. This is needed to workaround dotnet/arcade#4763 * Add missing '\'; improve a condition * Add `<UndefineProperties>TargetFramework;TargetFrameworks</UndefineProperties>` to native projects. This is needed to prevent these projects from building multiple times parallel.
1 parent dba2b14 commit 37b6121

File tree

4 files changed

+44
-5
lines changed

4 files changed

+44
-5
lines changed

eng/WpfArcadeSdk/tools/InlineTasks.targets

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,27 @@
77
<TaskFactoryAssemblyToUse Condition="'$(MSBuildProjectExtension)'=='.vcxproj'">$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll</TaskFactoryAssemblyToUse>
88
</PropertyGroup>
99

10+
<!--
11+
Summary:
12+
Selects @(Item2) items that are present in @(Item1). In effect, calculates
13+
set subtraction:
14+
15+
Result = Item2 - Item1
16+
17+
Parameters:
18+
@(Item1) ITaskItem[] Required
19+
PreserveItem1Metadata Bool Optional Preserves item-metadata from @(Item1) in @(Result)
20+
21+
@(Item2) ITaskItem[] Required
22+
Metadata2 String Required
23+
PreserveItem2Metadata Bool Optional Preserves item-metadata from @(Item2) in @(Result)
24+
25+
TreatItemsAsPaths Bool Optional
26+
27+
Outputs:
28+
@(Result) ITaskItem[]
29+
@(UnmatchedReferences) ITaskItem[]
30+
-->
1031
<UsingTask TaskName="FilterItem1ByItem2"
1132
TaskFactory="$(TaskFactoryToUse)"
1233
AssemblyFile="$(TaskFactoryAssemblyToUse)">

eng/WpfArcadeSdk/tools/Wpf.Cpp.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,14 @@
208208

209209
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
210210

211+
<!--
212+
Workaround for https://github.com/dotnet/arcade/issues/4763
213+
Embed PDB's into the .lib files directly using /Z7 when building out of
214+
dotnet-wpf-int repo
215+
-->
216+
<DebugInformationFormat Condition="'$(ManagedCxx)' != 'true' and
217+
'$(RepoLocation)' == 'Internal'">oldStyle</DebugInformationFormat>
218+
211219
<!--
212220
Disambiguate the PDB produced by the compiler with a -compile suffix, so that the PDB
213221
produced by the linker is not accidentally clobbered by this one.

eng/WpfArcadeSdk/tools/Wpf.Cpp.targets

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,15 @@ using namespace System::Runtime::Versioning;
462462
The main purpose of this target is to restore the package with PathProperty=true. As a side-effect,
463463
we will also generate an Item @(NuGetReferencesForCpp) from IdentifyNuGetReferences target, which
464464
will be used by ResolveMicrosoftDotNetWpfDncEngReferencesForCpp
465+
466+
Note:
467+
Test for "$(RepoLocation) != Internal" rather than "$(RepoLocation) == External"
468+
The former form is more reliable.
469+
465470
-->
466471
<Target Name="CppHelper"
467472
Returns="@(NuGetReferencesForCpp)"
468-
Condition="'$(ManagedCxx)' != 'true' and '$(RepoLocation)' == 'External'">
473+
Condition="'$(ManagedCxx)' != 'true' and '$(RepoLocation)' != 'Internal'">
469474

470475
<PropertyGroup>
471476
<CppHelperProject>$(IntermediateOutputPath)CppSupport\CppSupport_$(MSBuildProjectName).csproj</CppHelperProject>
@@ -499,8 +504,9 @@ using namespace System::Runtime::Versioning;
499504
<![CDATA[
500505
<ItemGroup>
501506
<PackageReference Include="runtime.$(WpfRuntimeIdentifier).Microsoft.DotNet.Wpf.DncEng"
502-
Version="$(MicrosoftDotNetWpfDncEngVersion)"
503-
GeneratePathProperty="true" />
507+
Condition="'$(MicrosoftDotNetWpfDncEngVersion)' != ''"
508+
Version="$(MicrosoftDotNetWpfDncEngVersion)"
509+
GeneratePathProperty="true" />
504510
</ItemGroup>
505511
]]>
506512
</Text>
@@ -521,7 +527,7 @@ using namespace System::Runtime::Versioning;
521527
522528
<PropertyGroup>
523529
<WpfDncEngRidSpecificLibPath Condition="'%24(RuntimeIdentifier)'=='win-x86' Or '%24(WpfRuntimeIdentifier)'=='win-x86'">%24(Pkgruntime_win-x86_Microsoft_DotNet_Wpf_DncEng)\runtimes\%24(RuntimeIdentifier)\native\</WpfDncEngRidSpecificLibPath>
524-
<WpfDncEngRidSpecificLibPath Condition="'%24(RuntimeIdentifier)'=='win-x64' Or '%24(WpfRuntimeIdentifier)'=='win-x64'">%24(Pkgruntime_win-x64_Microsoft_DotNet_Wpf_DncEng)runtimes\%24(RuntimeIdentifier)\native\</WpfDncEngRidSpecificLibPath>
530+
<WpfDncEngRidSpecificLibPath Condition="'%24(RuntimeIdentifier)'=='win-x64' Or '%24(WpfRuntimeIdentifier)'=='win-x64'">%24(Pkgruntime_win-x64_Microsoft_DotNet_Wpf_DncEng)\runtimes\%24(RuntimeIdentifier)\native\</WpfDncEngRidSpecificLibPath>
525531
</PropertyGroup>
526532
<!-- Save Microsoft.NETCore.App assemblies and return them -->
527533
<ItemGroup>
@@ -564,7 +570,7 @@ using namespace System::Runtime::Versioning;
564570
<MSBuild Projects="@(ProjectToBuild)"
565571
Targets="IdentifyNuGetReferences"
566572
Properties="TargetFramework=$(TfmForBuild);Platform=$(Architecture);RuntimeIdentifier=win-$(Architecture)">
567-
<Output TaskParameter="TargetOutputs" ItemName="NuGetReferencesForCpp" />
573+
<Output TaskParameter="TargetOutputs" ItemName="NuGetReferencesForCpp" />
568574
</MSBuild>
569575

570576
<!-- Update with file path -->

eng/WpfArcadeSdk/tools/WpfProjectReference.targets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,26 @@
5858
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
5959
<OutputItemType>Content</OutputItemType>
6060
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
61+
<UndefineProperties>TargetFramework;TargetFrameworks</UndefineProperties>
6162
</WpfProjectPath>
6263
<WpfProjectPath Include="WpfGfx_cor3" ProjectPath="$(WpfSourceDir)WpfGfx\core\dll\WpfGfx.vcxproj">
6364
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
6465
<OutputItemType>Content</OutputItemType>
6566
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
67+
<UndefineProperties>TargetFramework;TargetFrameworks</UndefineProperties>
6668
</WpfProjectPath>
6769
<WpfProjectPath Include="PenImc_cor3" ProjectPath="$(WpfSourceDir)PenImc\dll\PenImc.vcxproj">
6870
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
6971
<OutputItemType>Content</OutputItemType>
7072
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
73+
<UndefineProperties>TargetFramework;TargetFrameworks</UndefineProperties>
7174
</WpfProjectPath>
7275

7376
<WpfProjectPath Include="bilinearspan" ProjectPath="$(WpfSourceDir)WpfGfx\core\sw\bilinearspan\bilinearspan.vcxproj">
7477
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
7578
<OutputItemType>Content</OutputItemType>
7679
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
80+
<UndefineProperties>TargetFramework;TargetFrameworks</UndefineProperties>
7781
</WpfProjectPath>
7882

7983
</ItemGroup>

0 commit comments

Comments
 (0)