forked from microsoft/undocked
-
Notifications
You must be signed in to change notification settings - Fork 0
/
windows.undocked.props
410 lines (410 loc) · 18.5 KB
/
windows.undocked.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Set up properties -->
<PropertyGroup>
<Error Condition="'$(UndockedType)' == ''">Must set UndockedType in project file</Error>
<UndockedDir Condition="'$(UndockedDir)' == ''">$(SolutionDir)undocked\</UndockedDir>
<UndockedOut Condition="'$(UndockedOut)' == ''">$(SolutionDir)build\</UndockedOut>
<UndockedLoc Condition="'$(UndockedLoc)' == ''">false</UndockedLoc>
<UndockedSourceLink Condition="'$(UndockedSourceLink)' == ''">false</UndockedSourceLink>
<UndockedVerFile Condition="'$(UndockedVerFile)' == ''">$(SolutionDir)version.json</UndockedVerFile>
<UndockedBuildId Condition="'$(UndockedBuildId)' == ''">0</UndockedBuildId>
<UndockedOfficial Condition="'$(UndockedOfficial)' == ''">false</UndockedOfficial>
<UndockedUseDriverToolset Condition="'$(UndockedUseDriverToolset)' == ''">false</UndockedUseDriverToolset>
<UndockedSigning Condition="'$(UndockedSigning)' == ''">false</UndockedSigning>
<UndockedVersioning Condition="'$(UndockedVersioning)' == ''">true</UndockedVersioning>
<UndockedKernelModeBuild>false</UndockedKernelModeBuild>
<!-- Disable ARM64X unless explicitly enabled -->
<UndockedBuildArm64x Condition="'$(UndockedBuildArm64x)' == '' OR $(ARM64X_DISABLED) == '1'">false</UndockedBuildArm64x>
<!-- Use the official LKG complier when available -->
<UseInternalMSUniCrtPackage>true</UseInternalMSUniCrtPackage>
</PropertyGroup>
<!-- The set of supported user mode configurations (x86,x64,arm,arm64) -->
<ItemGroup Label="ProjectConfigurations" Condition="'$(UndockedType)' != 'sys'">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64EC">
<Configuration>Debug</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64EC">
<Configuration>Release</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
</ItemGroup>
<!-- The set of supported kernel configurations (only 64-bit platforms) -->
<ItemGroup Label="ProjectConfigurations" Condition="'$(UndockedType)' == 'sys'">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64EC">
<Configuration>Debug</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64EC">
<Configuration>Release</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
</ItemGroup>
<!-- Configuration properties to match Windows -->
<PropertyGroup>
<WinConfig Condition="'$(Configuration)' == 'Release'">fre</WinConfig>
<WinConfig Condition="'$(Configuration)' == 'Debug'">chk</WinConfig>
</PropertyGroup>
<PropertyGroup>
<WinPlat Condition="'$(Platform)' == 'Win32'">x86</WinPlat>
<WinPlat Condition="'$(Platform)' == 'x64'">amd64</WinPlat>
<WinPlat Condition="'$(Platform)' == 'ARM64'">arm64</WinPlat>
<WinPlat Condition="'$(Platform)' == 'ARM64EC'">arm64ec</WinPlat>
</PropertyGroup>
<!--The following lines configure the properties needed for sourcelink support -->
<Import Project="$(SolutionDir)packages\Microsoft.SourceLink.AzureRepos.Git.1.0.0\build\Microsoft.SourceLink.AzureRepos.Git.props" Condition="$(UndockedSourceLink) AND Exists('$(SolutionDir)packages\Microsoft.SourceLink.AzureRepos.Git.1.0.0\build\Microsoft.SourceLink.AzureRepos.Git.props')" />
<Import Project="$(SolutionDir)packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props" Condition="$(UndockedSourceLink) AND Exists('$(SolutionDir)packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" />
<Import Project="$(SolutionDir)packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props" Condition="$(UndockedSourceLink) AND Exists('$(SolutionDir)packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" />
<Import Project="$(SolutionDir)packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props" Condition="$(UndockedSourceLink) AND Exists('$(SolutionDir)packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" />
<!-- Default global properties -->
<PropertyGroup>
<TargetVersion>Windows10</TargetVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<PropertyGroup Condition="'$(UndockedUseDriverToolset)' == 'false'">
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(UndockedUseDriverToolset)' == 'true'">
<PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<!-- Per-type Configuration -->
<PropertyGroup Condition="'$(UndockedType)' == 'lib'">
<ConfigurationType>StaticLibrary</ConfigurationType>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
</PropertyGroup>
<PropertyGroup Condition="'$(UndockedType)' == 'dll'">
<ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(UndockedType)' == 'exe'">
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(UndockedType)' == 'drvlib'">
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>StaticLibrary</ConfigurationType>
<DriverType>KMDF</DriverType>
<UndockedKernelModeBuild>true</UndockedKernelModeBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(UndockedType)' == 'sys'">
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>Driver</ConfigurationType>
<DriverType>KMDF</DriverType>
<UndockedKernelModeBuild>true</UndockedKernelModeBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(UndockedType)' == 'none'">
<ConfigurationType>none</ConfigurationType>
</PropertyGroup>
<!-- Calculate version properties for resource compile -->
<Target Name="VersionProperties" BeforeTargets="ClCompile;ResourceCompile" Condition="'$(UndockedVersioning)'!='false'">
<Exec Command="git describe --long --always --exclude=* --abbrev=8" ConsoleToMSBuild="True" IgnoreExitCode="False">
<Output PropertyName="UndockedGitHash" TaskParameter="ConsoleOutput"/>
</Exec>
<Exec Command="PowerShell -Command "(Get-Content -Raw $(UndockedVerFile) | ConvertFrom-Json).major"" ConsoleToMSBuild="True" IgnoreExitCode="False">
<Output PropertyName="UndockedMajorVersion" TaskParameter="ConsoleOutput"/>
</Exec>
<Exec Command="PowerShell -Command "(Get-Content -Raw $(UndockedVerFile) | ConvertFrom-Json).minor"" ConsoleToMSBuild="True" IgnoreExitCode="False">
<Output PropertyName="UndockedMinorVersion" TaskParameter="ConsoleOutput"/>
</Exec>
<Exec Command="PowerShell -Command "(Get-Content -Raw $(UndockedVerFile) | ConvertFrom-Json).patch"" ConsoleToMSBuild="True" IgnoreExitCode="False">
<Output PropertyName="UndockedPatchVersion" TaskParameter="ConsoleOutput"/>
</Exec>
<ItemGroup>
<ClCompile>
<PreprocessorDefinitions>
VER_MAJOR=$(UndockedMajorVersion);
VER_MINOR=$(UndockedMinorVersion);
VER_PATCH=$(UndockedPatchVersion);
VER_BUILD_ID=$(UndockedBuildId);
VER_GIT_HASH=$(UndockedGitHash);
%(ClCompile.PreprocessorDefinitions)
</PreprocessorDefinitions>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>
VER_MAJOR=$(UndockedMajorVersion);
VER_MINOR=$(UndockedMinorVersion);
VER_PATCH=$(UndockedPatchVersion);
VER_BUILD_ID=$(UndockedBuildId);
VER_GIT_HASH=$(UndockedGitHash);
%(ResourceCompile.PreprocessorDefinitions)
</PreprocessorDefinitions>
</ResourceCompile>
</ItemGroup>
</Target>
<!-- Import the default build properties first -->
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<!-- Official Windows compiler and linker settings -->
<PropertyGroup>
<UndockedPlatConfig>$(Platform)_$(Configuration)</UndockedPlatConfig>
<IntDir>$(UndockedOut)obj\$(UndockedPlatConfig)\$(ProjectName)\</IntDir>
<OutDir>$(UndockedOut)bin\$(UndockedPlatConfig)\</OutDir>
<UseDebugLibraries Condition="'$(Configuration)'=='Debug'">true</UseDebugLibraries>
<UseDebugLibraries Condition="'$(Configuration)'=='Release'">false</UseDebugLibraries>
<SignMode Condition="'$(UndockedSigning)' == 'false'">Off</SignMode>
<DriverSign Condition="'$(UndockedSigning)' != 'false'">
<FileDigestAlgorithm>$(UndockedSigning)</FileDigestAlgorithm>
</DriverSign>
<EnableInf2cat>false</EnableInf2cat>
<InfVerif_AdditionalOptions>/msft</InfVerif_AdditionalOptions>
<SpectreMitigation>Spectre</SpectreMitigation>
<Driver_SpectreMitigation>Spectre</Driver_SpectreMitigation>
</PropertyGroup>
<ItemDefinitionGroup>
<ResourceCompile>
<AdditionalIncludeDirectories>$(UndockedDir)\vs;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<ClCompile>
<SDLCheck>true</SDLCheck>
<ControlFlowGuard>Guard</ControlFlowGuard>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<SupportJustMyCode></SupportJustMyCode> <!-- Disable /JMC -->
<TreatWarningAsError>true</TreatWarningAsError>
<PreprocessorDefinitions Condition="$(UndockedKernelModeBuild)">
KERNEL_MODE=1;
%(ClCompile.PreprocessorDefinitions)
</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(UndockedKernelModeBuild)'=='false'">
USER_MODE=1;
%(ClCompile.PreprocessorDefinitions)
</PreprocessorDefinitions>
</ClCompile>
<!-- Architecture definitions for certain header files from Windows Kits -->
<ClCompile Condition="'$(Platform)'=='Win32'">
<PreprocessorDefinitions>_X86_;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Condition="'$(Platform)'=='x64'">
<PreprocessorDefinitions>_AMD64_;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Condition="$(Platform.StartsWith('ARM64'))">
<PreprocessorDefinitions>_ARM64_;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<!-- Debug/Release related definitions -->
<ClCompile Condition="'$(Configuration)'=='Debug'">
<PreprocessorDefinitions>DBG;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<ClCompile Condition="'$(Configuration)'=='Release'">
<PreprocessorDefinitions>NDEBUG;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem Condition="'$(UndockedType)' == 'exe'">Console</SubSystem>
<CETCompat Condition="'$(Platform)'!='ARM64'">true</CETCompat>
</Link>
</ItemDefinitionGroup>
<!-- Enable ARM64X compilation -->
<PropertyGroup Condition="'$(Platform)'=='ARM64' AND '$(UndockedType)' != 'sys' AND '$(UndockedType)' != 'drvlib' AND '$(UndockedType)' != 'exe' AND '$(UndockedBuildArm64x)' == 'true'">
<BuildAsX>true</BuildAsX>
</PropertyGroup>
<!-- Unofficial build flags, but close enough for local testing -->
<ItemDefinitionGroup Condition="'$(UndockedOfficial)' == 'false'">
<ClCompile>
<PreprocessorDefinitions>
Brepo;
__WRL_CONFIGURATION_LEGACY__;
_APISET_MINCORE_VERSION=0x0110;
_APISET_MINWIN_VERSION=0x0111;
_CONTROL_FLOW_GUARD_SVCTAB=1;
_CONTROL_FLOW_GUARD_XFG=1;
_CRT_STDIO_IMP_ALT=;
_CRT_STDIO_IMP=;
_DLL=1;
_FULL_IOBUF;
_HAS_MAGIC_STATICS=1;
_MT=1;
_NT1X_=100;
_USE_DECLSPECS_FOR_SAL=1;
_USE_DEV11_CRT;
_WIN32_IE=0x0A00;
BUILD_UMS_ENABLED=1;
BUILD_WINDOWS;
CONDITION_HANDLING=1;
DEVL=1;
DONT_DISABLE_PCH_WARNINGS_IN_WARNING_H;
EXECUTABLE_WRITES_SUPPORT=0;
FE_IME;
FE_SB;
NT;
NT_INST=0;
NT_UP=1;
UNDOCKED_WINDOWS_UCRT;
WIN32=100;
WINBLUE_KBSPRING14;
%(ClCompile.PreprocessorDefinitions)
</PreprocessorDefinitions>
<AdditionalOptions>
/d1guard:xfg
/d1import_no_registry
/d1nodatetime
/d2AllowCompatibleILVersions
/d2DeepThoughtInliner-
/d2FH4
/d2guardehcont
/d2guardspecanalysismode:v1_0
/d2guardspecmode2
/d2guardxfg
/d2Qvec-mathlib-
/d2Qvec-sse2only
/d2Zi+
/GF
/Gw
/Gy
/MP
/Zc:alignedNew-
/Zc:noexceptTypes
/Zc:rvalueCast
/Zc:sizedDealloc-
/Zc:tlsGuards-
/ZH:SHA_256
/Zp8
</AdditionalOptions>
<AdditionalOptions Condition="$(UndockedKernelModeBuild)">
/kernel
%(AdditionalOptions)
</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalOptions>
/baserelocclustering
/Brepro
/d2:-DeepThoughtInliner-
/d2:-FH4
/d2:-guard4
/d2:-guardcfgfuncptr
/d2:-guardspecanalysismode:v1_0
/d2:-guardspecload
/d2:-guardspecmode2
/d2:-nocfgrngchk
/d2:-SpecDevirt-
/d2:-TypeProp-
/debugtype:cv,fixup,pdata
/filealign:0x1000
/functionpadmin:6
/guard:export
/guard:longjmp
/guard:mixed
/NODEFAULTLIB:libucrt.lib
/NOVCFEATURE
/OPT:ICF
/OPT:REF
/osversion:10.0
/pdbcompress
/PDBDLL:mspdbcore.dll
/pdbrpc:no
/release
/RetryOnFileOpenFailure
/RunBelow4GB
/STACK:0x80000,0x2000
/version:10.0
</AdditionalOptions>
<AdditionalOptions Condition="'$(UndockedType)'=='EXE'">
/tsaware
%(AdditionalOptions)
</AdditionalOptions>
<AdditionalOptions Condition="$(UndockedKernelModeBuild)">
/d2:-guardcfgdispatch
/guard:exportsuppress
/kernel
/merge:.gfids=GFIDS
/merge:.orpc=.text
/merge:_RDATA=.rdata
/section:GFIDS,d
%(AdditionalOptions)
</AdditionalOptions>
<AdditionalOptions Condition="'$(Platform)'=='x86'">
/DynamicValueFixupSym:mm_shared_user_data_va=0x7FFE0000
/guard:xfg
%(AdditionalOptions)
</AdditionalOptions>
<AdditionalOptions Condition="'$(Platform)'=='x64'">
/DynamicValueFixupSym:mm_shared_user_data_va=0x7FFE0000
/DynamicValueFixupSym:ki_user_shared_data=0xFFFFF78000000000
/guard:ehcont
/guard:xfg
/highentropyva
%(AdditionalOptions)
</AdditionalOptions>
<AdditionalOptions Condition="$(Platform.StartsWith('ARM64'))">
<!-- /DynamicValueFixupSym:ki_user_shared_data=0xFFFFF78000000000 -->
/highentropyva
%(AdditionalOptions)
</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<!-- Enable retpoline for MASM in official builds - template does not currently set this -->
<ItemDefinitionGroup Condition="'$(UndockedOfficial)' == 'true' And '$(Platform)'=='x64'">
<MASM>
<AdditionalOptions>/GuardRetpoline %(AdditionalOptions)</AdditionalOptions>
</MASM>
</ItemDefinitionGroup>
<!-- Enable static analysis during the build (currently breaks in official builds) -->
<PropertyGroup Condition="'$(UndockedOfficial)' == 'false'">
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<CodeAnalysisLogFile>$(IntDir)CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisSucceededFile>$(IntDir)build.lastcodeanalysissucceeded</CodeAnalysisSucceededFile>
</PropertyGroup>
<!-- Helpers for localization -->
<ItemDefinitionGroup Condition="$(UndockedLoc)">
<ResourceCompile>
<AdditionalOptions Condition="'$(UndockedType)' != 'sys'">/r /fm $(IntDir)$(TargetName).muires /q $(UndockedDir)vs\mui.rcconfig /g 0x0409 %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(UndockedType)' == 'sys'">/r /fm $(IntDir)$(TargetName).muires /q $(UndockedDir)vs\mui_drv.rcconfig /g 0x0409 %(AdditionalOptions)</AdditionalOptions>
</ResourceCompile>
<PostBuildEvent>
<Command>mkdir $(OutDir)en-US >nul 2>&1
link.exe /OUT:"$(OutDir)en-US\$(TargetFileName).mui" /DLL /NOENTRY /MACHINE:$(WinPlat) "$(IntDir)$(TargetName).muires"
muirct.exe -c $(TargetPath) -e "$(OutDir)en-US\$(TargetFileName).mui"
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<!-- Other Imports -->
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="Shared" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
</Project>