Skip to content

Commit

Permalink
Properly indicate to MSBuild and the .NET SDK whether we're producing…
Browse files Browse the repository at this point in the history
… a separate PDB.
  • Loading branch information
alexrp committed Jul 22, 2021
1 parent cd03523 commit e7421d8
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/sdk/Sdk/Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

<Import Project="../build/Zig.Sdk.Overrides.targets" />
<Import Project="../build/Zig.Sdk.Cross.targets" />
<Import Project="../build/Zig.Sdk.Symbols.targets" />
<Import Project="Sdk.targets"
Sdk="Microsoft.NET.Sdk" />
<Import Project="../build/Zig.Sdk.Hacks.targets" />
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/Sdk/Support.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<!--
This file is meant to be imported in regular .NET SDK projects. It injects
some build logic to make ZigReference items work as expected.
This file is meant to be imported in regular Microsoft.NET.Sdk projects. It
injects some build logic to make ZigReference items work as expected.
-->
</Project>
4 changes: 2 additions & 2 deletions src/sdk/build/Zig.Sdk.Hacks.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<!--
The .NET SDK unconditionally sets TargetExt to force a .dll suffix. We work
around that nonsense here.
Microsoft.NET.Sdk unconditionally sets TargetExt to force a .dll suffix. We
work around that nonsense here.
-->
<PropertyGroup>
<TargetExt>$(TargetSuffix)</TargetExt>
Expand Down
6 changes: 3 additions & 3 deletions src/sdk/build/Zig.Sdk.Publish.targets
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
</Target>

<!--
Unfortunately, the publish logic in the .NET SDK is not factored as well as
the build and clean logic in MSBuild, so we have to duplicate some of the
logic in the default Publish target here.
Unfortunately, the publish logic in Microsoft.NET.Sdk is not factored as
well as the build and clean logic in MSBuild, so we have to duplicate some
of the logic in the default Publish target here.
-->
<Target Name="_InnerPublish"
DependsOnTargets="_PublishBuildAlternative; _PublishNoBuildAlternative">
Expand Down
17 changes: 17 additions & 0 deletions src/sdk/build/Zig.Sdk.Symbols.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project>
<!--
We need to set these properties up here since Microsoft.NET.Sdk defaults
them very early and sets _DebugSymbolsProduced to indicate whether a
separate PDB file is produced.
-->

<PropertyGroup Condition="'$(DebugSymbols)' == ''">
<DebugSymbols>false</DebugSymbols>
<DebugSymbols Condition="'$(Configuration)' == 'Debug'">true</DebugSymbols>
</PropertyGroup>

<PropertyGroup Condition="'$(DebugSymbols)' == 'true'">
<DebugType>embedded</DebugType>
<DebugType Condition="'$(TargetSystem)' == 'windows'">full</DebugType>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions src/sdk/build/Zig.Sdk.Test.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
</ItemGroup>

<!--
Most of the test logic in the .NET SDK is superfluous for our purposes, so
we will just override the target entirely.
Most of the test logic in Microsoft.NET.Sdk is superfluous for our purposes,
so we will just override the target entirely.
-->
<Target Name="VSTest"
DependsOnTargets="$(VSTestDependsOn)"
Expand Down

0 comments on commit e7421d8

Please sign in to comment.