-
Notifications
You must be signed in to change notification settings - Fork 290
Expand file tree
/
Copy pathwdk.props
More file actions
63 lines (59 loc) · 6.52 KB
/
Copy pathwdk.props
File metadata and controls
63 lines (59 loc) · 6.52 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
51
52
53
54
55
56
57
58
59
60
61
62
63
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) eBPF for Windows contributors
SPDX-License-Identifier: MIT
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="Platform">
<PropertyGroup>
<HostPlatform Condition="'$(HostPlatform)' == ''">$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)</HostPlatform>
<!-- Target/toolset/WDK selection. All three use the same '>= 18.0' vs '< 18.0' split so we
never end up partially configured (e.g. WDKVersion set but toolset empty) on an
unexpected VisualStudioVersion. Each property can be overridden from the command line. -->
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == '' and '$(VisualStudioVersion)' >= '18.0'">10.0.28000.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == '' and '$(VisualStudioVersion)' < '18.0'">10.0.26100.0</WindowsTargetPlatformVersion>
<!-- WDK NuGet package version: VS 2026 (MSBuild 18) requires 10.0.28000.1839;
VS 2022 (MSBuild 17) uses 10.0.26100.6584. -->
<WDKVersion Condition="'$(WDKVersion)' == '' and '$(VisualStudioVersion)' >= '18.0'">10.0.28000.1839</WDKVersion>
<WDKVersion Condition="'$(WDKVersion)' == '' and '$(VisualStudioVersion)' < '18.0'">10.0.26100.6584</WDKVersion>
<!-- Provide DDK_INC_PATH for user-mode projects that simulate kernel code (usersim) -->
<DDK_INC_PATH Condition="'$(DDK_INC_PATH)' == ''">$(SolutionDir)packages\Microsoft.Windows.WDK.$(Platform).$(WDKVersion)\c\Include\$(WindowsTargetPlatformVersion)\km</DDK_INC_PATH>
<!-- Default platform toolset for user-mode projects. Kernel-mode projects override this
with WindowsKernelModeDriver10.0 in their vcxproj Configuration PropertyGroups. -->
<EbpfPlatformToolset Condition="'$(EbpfPlatformToolset)' == '' and '$(VisualStudioVersion)' >= '18.0'">v145</EbpfPlatformToolset>
<EbpfPlatformToolset Condition="'$(EbpfPlatformToolset)' == '' and '$(VisualStudioVersion)' < '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 the eBPF-for-Windows solution, so the toolset variable its vcxproj files reference
($(EbpfExtPlatformToolset)) must be defined here. Without it the toolset is empty and MSBuild
falls back to v100, causing MSB8020. (usersim is self-contained: its projects import their own
wdk.props via a relative path, so no equivalent definition is needed here.) -->
<EbpfExtPlatformToolset Condition="'$(EbpfExtPlatformToolset)' == '' and '$(VisualStudioVersion)' >= '18.0'">v145</EbpfExtPlatformToolset>
<EbpfExtPlatformToolset Condition="'$(EbpfExtPlatformToolset)' == '' and '$(VisualStudioVersion)' < '18.0'">v143</EbpfExtPlatformToolset>
</PropertyGroup>
<!-- Log the WDK version -->
<Target Name="LogWDKVersion" BeforeTargets="PrepareForBuild">
<Message Importance="high" Text="Using WDK version $(WDKVersion)" />
<Message Importance="high" Text="Using Windows target platform version $(WindowsTargetPlatformVersion)" />
<Message Importance="high" Text="Using host platform $(HostPlatform)" />
<Message Importance="high" Text="Using target platform $(Platform)" />
<Message Importance="high" Text="PROCESSOR_ARCHITECTURE is $(PROCESSOR_ARCHITECTURE)" />
<Message Importance="high" Text="PROCESSOR_ARCHITEW6432 is $(PROCESSOR_ARCHITEW6432)" />
</Target>
<!-- SDK NuGet imports -->
<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.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')" />
<!-- WDK NuGet import (sets PlatformToolset to WindowsKernelModeDriver10.0) -->
<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')" />
<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>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)packages\Microsoft.Windows.SDK.CPP.$(WDKVersion)\build\native\Microsoft.Windows.SDK.cpp.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)packages\Microsoft.Windows.SDK.CPP.$(WDKVersion)\build\native\Microsoft.Windows.SDK.cpp.props'))" />
<Error Condition="!Exists('$(SolutionDir)packages\Microsoft.Windows.SDK.CPP.$(WDKVersion)\build\native\Microsoft.Windows.SDK.cpp.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)packages\Microsoft.Windows.SDK.CPP.$(WDKVersion)\build\native\Microsoft.Windows.SDK.cpp.targets'))" />
<Error Condition="!Exists('$(SolutionDir)packages\Microsoft.Windows.SDK.CPP.$(Platform).$(WDKVersion)\build\native\Microsoft.Windows.SDK.cpp.$(Platform).props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)packages\Microsoft.Windows.SDK.CPP.$(Platform).$(WDKVersion)\build\native\Microsoft.Windows.SDK.cpp.$(Platform).props'))" />
<Error Condition="!Exists('$(SolutionDir)packages\Microsoft.Windows.WDK.$(Platform).$(WDKVersion)\build\native\Microsoft.Windows.WDK.$(Platform).props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)packages\Microsoft.Windows.WDK.$(Platform).$(WDKVersion)\build\native\Microsoft.Windows.WDK.$(Platform).props'))" />
</Target>
</Project>