Fix build break where Microsoft.Terminal.Control.dll is empty (#9537)

TIL that the `<None Include="Foo.def" />` line in our projects is
actually totally meaningless. The important line is the one that's in
`cppwinrt.build.pre.props`, where we declare 

```xml
<ModuleDefinitionFile Condition="Exists('$(ProjectName).def')">$(ProjectName).def</ModuleDefinitionFile>
```

So if you change a project's name, and not the `.def` file, then the
linker will just _not use the `.def` file at all_.

More importantly, this seemingly doesn't matter in debug builds. In a
Debug build, the linker will happily still include `WINRT_CanUnloadNow`
and `WINRT_GetActivationFactory` in the exports from the dll, even
without the `.def`. But in a Release build, the linker is much more
agressive about pruning symbols that aren't referenced, and without
those two, NONE of the symbols are eventually referenced.

This PR fixes `Microsoft.Terminal.Control` by renaming the `.def`, and
makes it marginally harder for someone to make the same mistake in the
future.

## References
* Regressed in #9472 

## PR Checklist
* [x] Closes #9529
* [x] I work here
This commit is contained in:
Mike Griese 2021-03-18 11:14:21 -05:00 committed by GitHub
parent acdcdcaccb
commit 2ed367fb49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 8 additions and 8 deletions

View file

@ -33,7 +33,7 @@
<!-- ========================= Misc Files ======================== -->
<ItemGroup>
<None Include="packages.config" />
<None Include="Microsoft.Terminal.Remoting.def" />
<None Include="$(ProjectName).def" />
</ItemGroup>
<!-- ========================= Project References ======================== -->
<ItemGroup>

View file

@ -31,7 +31,7 @@
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="WindowsTerminalShellExt.def" />
<None Include="$(ProjectName).def" />
</ItemGroup>
<!-- ========================= Project References ======================== -->
<ItemGroup>

View file

@ -47,7 +47,7 @@
<!-- ========================= Misc Files ======================== -->
<ItemGroup>
<None Include="packages.config" />
<None Include="TerminalApp.def" />
<None Include="$(ProjectName).def" />
</ItemGroup>
<!-- ========================= Project References ======================== -->
<ItemGroup>

View file

@ -47,7 +47,7 @@
<!-- ========================= Misc Files ======================== -->
<ItemGroup>
<None Include="packages.config" />
<None Include="TerminalControl.def" />
<None Include="$(ProjectName).def" />
</ItemGroup>
<!-- ========================= Project References ======================== -->
<ItemGroup>

View file

@ -245,7 +245,7 @@
<SubType>Designer</SubType>
</PRIResource>
<OCResourceDirectory Include="Resources" />
<None Include="TerminalSettingsEditor.def" />
<None Include="$(ProjectName).def" />
<None Include="packages.config" />
<None Include="PropertySheet.props" />
</ItemGroup>

View file

@ -22,7 +22,7 @@
</Midl>
</ItemGroup>
<ItemGroup>
<None Include="TerminalSettingsEditor.def" />
<None Include="Microsoft.Terminal.Settings.Editor.def" />
<None Include="packages.config" />
<None Include="PropertySheet.props" />
</ItemGroup>
@ -41,4 +41,4 @@
<UniqueIdentifier>{00f725c8-41b4-40a8-995e-8ee2e49a4a4c}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
</Project>

View file

@ -41,7 +41,7 @@
<!-- ========================= Misc Files ======================== -->
<ItemGroup>
<None Include="packages.config" />
<None Include="Microsoft.Terminal.Settings.Model.def" />
<None Include="$(ProjectName).def" />
</ItemGroup>
<!-- ========================= Project References ======================== -->
<ItemGroup>