-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathwdk.props
More file actions
50 lines (47 loc) · 4.88 KB
/
Copy pathwdk.props
File metadata and controls
50 lines (47 loc) · 4.88 KB
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
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) Microsoft Corporation
SPDX-License-Identifier: MIT
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="Platform">
<PropertyGroup>
<HostPlatform>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)</HostPlatform>
<!-- Visual Studio 2026 (MSBuild 18.0+) requires the newer WDK; Visual Studio 2022 (MSBuild 17)
uses the prior WDK. The matching NuGet packages for both versions are listed in
scripts\setup_build\packages.config so the imports below resolve to whichever toolset is active.
These gate on $(MSBuildAssemblyVersion) rather than $(VisualStudioVersion). $(VisualStudioVersion)
is only populated when the build is launched from a Developer Command Prompt / VS and is empty
when msbuild.exe is invoked directly, which silently selected the VS2022 WDK under MSBuild 18.
That produced a mismatched pair (target platform 10.0.28000.0 with WDK 10.0.26100.4204) and
failed with MSB4062 loading Microsoft.DriverKit.Build.Tasks.18.0.dll, an assembly the 26100
package does not ship, plus MSB8036 for the missing 10.0.28000.0 SDK. $(MSBuildAssemblyVersion)
is always defined and is the same value the WDK targets use to pick that task assembly.
The fallbacks are explicitly conditioned on '< 18.0' rather than left unconditional so an
unexpected toolset version fails loudly instead of silently selecting the VS2022 WDK. -->
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == '' and '$(MSBuildAssemblyVersion)' >= '18.0'">10.0.28000.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == '' and '$(MSBuildAssemblyVersion)' < '18.0'">10.0.26100.0</WindowsTargetPlatformVersion>
<WDKVersion Condition="'$(WDKVersion)' == '' and '$(MSBuildAssemblyVersion)' >= '18.0'">10.0.28000.1839</WDKVersion>
<WDKVersion Condition="'$(WDKVersion)' == '' and '$(MSBuildAssemblyVersion)' < '18.0'">10.0.26100.4204</WDKVersion>
<!-- Default platform toolset for user-mode projects. Visual Studio 2026 (MSBuild 18) uses v145;
Visual Studio 2022 (MSBuild 17) uses v143. Kernel-mode projects override this with
WindowsKernelModeDriver10.0 in their own Configuration PropertyGroups. Keeping this in lockstep
with the WDK/target-platform selection above ensures Catch2 (built by the matching CMake
generator) and the user-mode projects share one toolset, avoiding STL link mismatches. -->
<EbpfPlatformToolset Condition="'$(EbpfPlatformToolset)' == '' and '$(MSBuildAssemblyVersion)' >= '18.0'">v145</EbpfPlatformToolset>
<EbpfPlatformToolset Condition="'$(EbpfPlatformToolset)' == '' and '$(MSBuildAssemblyVersion)' < '18.0'">v143</EbpfPlatformToolset>
<!-- Platform toolset consumed by the ebpf-extension-common submodule. Its Directory.Build.props
imports "$(SolutionDir)wdk.props", which resolves to THIS file when the submodule is built as
part of ntosebpfext.sln, so the toolset variable its vcxproj files reference
($(EbpfExtPlatformToolset)) must be defined here. Kept in lockstep with $(EbpfPlatformToolset)
so the submodule's user-mode lib and the consuming unit-test objects share one toolset
(mismatched toolsets cause C1047 under Release LTCG). -->
<EbpfExtPlatformToolset Condition="'$(EbpfExtPlatformToolset)' == '' and '$(MSBuildAssemblyVersion)' >= '18.0'">v145</EbpfExtPlatformToolset>
<EbpfExtPlatformToolset Condition="'$(EbpfExtPlatformToolset)' == '' and '$(MSBuildAssemblyVersion)' < '18.0'">v143</EbpfExtPlatformToolset>
</PropertyGroup>
<Import Project="$(SolutionDir)packages\Microsoft.Windows.SDK.CPP.$(WDKVersion)\build\native\Microsoft.Windows.SDK.cpp.props" Condition="Exists('$(SolutionDir)packages\Microsoft.Windows.SDK.CPP.$(WDKVersion)\build\native\Microsoft.Windows.SDK.cpp.props')" />
<Import Project="$(SolutionDir)packages\Microsoft.Windows.WDK.$(Platform).$(WDKVersion)\build\native\Microsoft.Windows.WDK.$(Platform).props" Condition="Exists('$(SolutionDir)packages\Microsoft.Windows.WDK.$(Platform).$(WDKVersion)\build\native\Microsoft.Windows.WDK.$(Platform).props')" />
<Import Project="$(SolutionDir)packages\Microsoft.Windows.SDK.CPP.$(Platform).$(WDKVersion)\build\native\Microsoft.Windows.SDK.cpp.$(Platform).props" Condition="Exists('$(SolutionDir)packages\Microsoft.Windows.SDK.CPP.$(Platform).$(WDKVersion)\build\native\Microsoft.Windows.SDK.cpp.$(Platform).props')" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(SolutionDir)packages\Microsoft.Windows.SDK.CPP.$(WDKVersion)\build\native\Microsoft.Windows.SDK.cpp.targets" Condition="Exists('$(SolutionDir)packages\Microsoft.Windows.SDK.CPP.$(WDKVersion)\build\native\Microsoft.Windows.SDK.cpp.targets')" />
</ImportGroup>
</Project>