9dc922fc37
This commit cleans up and deduplicates all of the common build preamble/postamble across exe, dll, lib and c++/winrt projects. The following specific changes have been made: * All projects now define their ConfigurationType * All projects now set all their properties *before* including a common build file (or any other build files) * cppwinrt.pre and cppwinrt.post now delegate most of their configuration to common.pre and common.post * (becuase of the above,) all build options are conserved between console and c++/winrt components, including specific warnings and preprocessor definitions. * More properties that are configurable per-project are now conditioned so the common props don't override them. * The exe, dll, exe.or.dll, and lib postincludes have been merged into pre or post and switched based on condition as required * Shared items (-shared, -common) are now explicitly vcxitems instead of vcxproj files. * The link line is now manipulated after Microsoft.Cpp sets it, so the libraries we specify "win". All console things link first against onecore_apiset.lib. * Fix all compilation errors caused by build unification * Move CascadiaPackage's resources into a separate item file Fixes #922.
112 lines
5.1 KiB
XML
112 lines
5.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
<PropertyGroup Label="Globals">
|
|
<ProjectGuid>{CA5CAD1A-44BD-4AC7-AC72-F16E576FDD12}</ProjectGuid>
|
|
<ProjectName>TerminalApp</ProjectName>
|
|
<RootNamespace>TerminalApp</RootNamespace>
|
|
<!-- cppwinrt.build.pre.props depends on these settings: -->
|
|
<!-- build a dll, not exe (Application) -->
|
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
|
<SubSystem>Console</SubSystem>
|
|
<!-- sets a bunch of Windows Universal properties -->
|
|
<OpenConsoleUniversalApp>true</OpenConsoleUniversalApp>
|
|
<!--
|
|
DON'T REDIRECT OUR OUTPUT.
|
|
Setting this will tell cppwinrt.build.post.props to copy our output from
|
|
the default OutDir up one level, so the wapproj will be able to find it.
|
|
-->
|
|
<NoOutputRedirection>true</NoOutputRedirection>
|
|
</PropertyGroup>
|
|
|
|
<Import Project="..\..\..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
|
|
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.pre.props" />
|
|
|
|
<!-- ========================= XAML files ======================== -->
|
|
<ItemGroup>
|
|
<!-- DON'T PUT XAML FILES HERE! Put them in TerminalAppLib.vcxproj -->
|
|
</ItemGroup>
|
|
|
|
<!-- ========================= Headers ======================== -->
|
|
<ItemGroup>
|
|
<!-- Only put headers for winrt types in here. Don't put other header files
|
|
in here - put them in TerminalAppLib.vcxproj instead! -->
|
|
<ClInclude Include="pch.h" />
|
|
<ClInclude Include="TerminalPage.h" />
|
|
<ClInclude Include="MinMaxCloseControl.h" />
|
|
<ClInclude Include="AppKeyBindings.h" />
|
|
<ClInclude Include="TitlebarControl.h" />
|
|
<ClInclude Include="TabRowControl.h" />
|
|
<ClInclude Include="App.h" />
|
|
</ItemGroup>
|
|
<!-- ========================= Cpp Files ======================== -->
|
|
<ItemGroup>
|
|
<!-- Don't put source files in here - put them in TerminalAppLib.vcxproj instead! -->
|
|
<ClCompile Include="pch.cpp">
|
|
<PrecompiledHeader>Create</PrecompiledHeader>
|
|
</ClCompile>
|
|
</ItemGroup>
|
|
<!-- ========================= idl Files ======================== -->
|
|
<ItemGroup>
|
|
<!-- DON'T PUT IDL FILES HERE! Put them in TerminalApp.vcxproj -->
|
|
</ItemGroup>
|
|
<!-- ========================= Misc Files ======================== -->
|
|
<ItemGroup>
|
|
<None Include="packages.config" />
|
|
<None Include="TerminalApp.def" />
|
|
</ItemGroup>
|
|
<!-- ========================= Project References ======================== -->
|
|
<ItemGroup>
|
|
<!--
|
|
the packaging project won't recurse through our dependencies, you have to
|
|
make sure that if you add a cppwinrt dependency to any of these projects,
|
|
you also update all the consumers
|
|
-->
|
|
<ProjectReference Include="$(OpenConsoleDir)src\types\lib\types.vcxproj">
|
|
<Project>{18D09A24-8240-42D6-8CB6-236EEE820263}</Project>
|
|
</ProjectReference>
|
|
|
|
<!-- The midl compiler however, _will_ aggregate our winmd dependencies
|
|
somehow. So make sure to only include top-level dependencies here (don't
|
|
include Settings and Connection, since Control will include them for us) -->
|
|
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalSettings\TerminalSettings.vcxproj" />
|
|
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalConnection\TerminalConnection.vcxproj" />
|
|
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalControl\TerminalControl.vcxproj" />
|
|
|
|
<!-- Reference TerminalAppLib here, so we can use it's TerminalApp.winmd as
|
|
our TerminalApp.winmd. This didn't work correctly in VS2017, you'd need to
|
|
manually reference the lib -->
|
|
|
|
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\TerminalApp\lib\TerminalAppLib.vcxproj" >
|
|
<Private>true</Private>
|
|
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
|
|
</ProjectReference>
|
|
|
|
</ItemGroup>
|
|
|
|
<PropertyGroup>
|
|
<!-- A small helper for paths to the compiled cppwinrt projects -->
|
|
<_BinRoot Condition="'$(Platform)' != 'Win32'">$(OpenConsoleDir)$(Platform)\$(Configuration)\</_BinRoot>
|
|
<_BinRoot Condition="'$(Platform)' == 'Win32'">$(OpenConsoleDir)$(Configuration)\</_BinRoot>
|
|
</PropertyGroup>
|
|
|
|
<ItemDefinitionGroup>
|
|
<ClCompile>
|
|
<AdditionalIncludeDirectories>$(OpenConsoleDir)\dep\jsoncpp\json;%(AdditionalIncludeDirectories);</AdditionalIncludeDirectories>
|
|
</ClCompile>
|
|
<Link>
|
|
<AdditionalDependencies>User32.lib;WindowsApp.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
|
|
<!-- TerminalAppLib contains a DllMain that we need to force the use of. -->
|
|
<AdditionalOptions Condition="'$(Platform)'=='Win32'">/INCLUDE:_DllMain@12</AdditionalOptions>
|
|
<AdditionalOptions Condition="'$(Platform)'!='Win32'">/INCLUDE:DllMain</AdditionalOptions>
|
|
</Link>
|
|
</ItemDefinitionGroup>
|
|
|
|
<Import Project="$(OpenConsoleDir)src\cppwinrt.build.post.props" />
|
|
|
|
<!-- Import this set of targets that fixes a VS bug that manifests when using
|
|
the TerminalAppLib project -->
|
|
<Import Project="FixVisualStudioBug.targets" />
|
|
|
|
</Project>
|