forked from microsoft/WindowsAppSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WindowsAppSDK.Build.Cpp.props
112 lines (97 loc) · 5.17 KB
/
WindowsAppSDK.Build.Cpp.props
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Build with the hybrid CRT (Universal CRT + Static VS CRT (for what little the Universal CRT doesn't cover) -->
<Import Project="$(MSBuildThisFileDirectory)HybridCRT.props" />
<!-- Build with APIscan-friendly compiler+linker options -->
<Import Project="$(MSBuildThisFileDirectory)ApiScan.Cpp.props" />
<!-- Common (all Configurations) options -->
<ItemDefinitionGroup>
<ClCompile>
<!-- /std:c++20 Enable ISO C++20 Standard -->
<LanguageStandard>stdcpp20</LanguageStandard>
<!-- /permissive- Enable Conformance mode (i.e. Disable 'permissive' mode) -->
<ConformanceMode>true</ConformanceMode>
<!-- /GR- Disable RTTI (causes binary bloat) -->
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<!-- /sdk Enable additional security checks-->
<SDLCheck>true</SDLCheck>
<!-- /W4 Enable max warning level -->
<WarningLevel>Level4</WarningLevel>
<!-- /Qspectre Specifies compiler generation of instructions to mitigate certain Spectre variant 1 security vulnerabilities. BinSkim asks for this. -->
<!-- /ZH:SHA_256 Hash algorithm for file checksums in debug info -->
<!-- /await:strict Enable coroutine support. Disable language extensions present in /await that weren't adopted into C++20 -->
<!-- /d1trimfile:$(RepoRoot) If the prefix for a source file path name string matches "trim-string" the prefix is replaced with the mapping-identifier (if present). Requires /Brepro. -->
<AdditionalOptions>%(AdditionalOptions) /Qspectre /ZH:SHA_256 /await:strict /d1trimfile:$(RepoRoot)</AdditionalOptions>
</ClCompile>
<Link>
<!-- /DEBUG:FULL Create PDF containing full debug information -->
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
<!-- /Brepro Enables deterministic output from the compiler toolchain -->
<!-- /PDBALTPATH Stops pdb's basepath from appearing in the Debug Directories of the image header -->
<!-- /CETCOMPAT enables Control-flow Enforcement Technology (CET) Shadow Stack mitigation.
BinSkim asks for this. /CETCOMPAT does not support arm64 -->
<AdditionalOptions Condition="'$(Platform)' == 'arm64'">%(AdditionalOptions) /Brepro /PDBALTPATH:$(TargetName).pdb</AdditionalOptions>
<AdditionalOptions Condition="'$(Platform)' != 'arm64'">%(AdditionalOptions) /Brepro /PDBALTPATH:$(TargetName).pdb /CETCOMPAT</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<!-- BinSkim emits errors or warnings without this settings -->
<PropertyGroup>
<SpectreMitigation>Spectre</SpectreMitigation>
</PropertyGroup>
<!-- Debug-specific options -->
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<!-- /INCREMENTAL Enable incremental linking -->
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)' == 'Debug'">
<ClCompile>
<!-- /d- Disable optimization -->
<Optimization>Disabled</Optimization>
</ClCompile>
<Link>
</Link>
</ItemDefinitionGroup>
<!-- Release-specific options -->
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<!-- /INCREMENTAL:NO Disable incremental linking -->
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)' == 'Release'">
<ClCompile>
<!-- /GS Enable Control Flow Guard -->
<ControlFlowGuard>Guard</ControlFlowGuard>
<!-- Compile-time optimizations:
/GF Enable read-only string pooling (eliminate duplicate strings)
/GL Whole Program Optimization
/Gy Enable function-level linking
/Gw Optimize Global Data (https://docs.microsoft.com/en-us/cpp/build/reference/gw-optimize-global-data)
-->
<StringPooling>true</StringPooling>
<WholeProgramOptimization>true</WholeProgramOptimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<AdditionalOptions>%(AdditionalOptions) /Gw</AdditionalOptions>
<!-- /Oxs Enable most speed optimizations
NOTE: /Oxs is short-hand for multiple options:
/Ob2 Enable inline function expansion (/Ob2 = Any Suitable)
/Oi Enable intrinsic functions
/Os Favor fast code
/Oy Omit frame pointers
-->
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
</ClCompile>
<Link>
<!-- Link-time optimizations:
/LCTG Enable Link Time Code Generation
/OPT:ICF Enable COMDAT folding
/OPT:REF Optimize references
-->
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
</Project>