-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
Copy pathMicrosoft.NETCore.Native.Windows.targets
144 lines (128 loc) · 8.55 KB
/
Microsoft.NETCore.Native.Windows.targets
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
<!--
***********************************************************************************************
Microsoft.NETCore.Native.Windows.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
This file defines Windows-specific steps in the build process for native AOT compilation.
Licensed to the .NET Foundation under one or more agreements.
The .NET Foundation licenses this file to you under the MIT license.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CppLinker>link</CppLinker>
<CppLibCreator>lib</CppLibCreator>
<ObjectSuffix>.obj</ObjectSuffix>
<LibrarySuffix>.lib</LibrarySuffix>
<FullRuntimeName>Runtime.WorkstationGC</FullRuntimeName>
<FullRuntimeName Condition="'$(ServerGarbageCollection)' == 'true' or '$(IlcLinkServerGC)' == 'true'">Runtime.ServerGC</FullRuntimeName>
<BootstrapperName>bootstrapper</BootstrapperName>
<BootstrapperName Condition="'$(NativeLib)' != '' or '$(CustomNativeMain)' == 'true'">bootstrapperdll</BootstrapperName>
<VxSortSupportName>Runtime.VxsortEnabled</VxSortSupportName>
<VxSortSupportName Condition="'$(OptimizationPreference)' == 'Size' or '$(IlcDisableVxsort)' == 'true'">Runtime.VxsortDisabled</VxSortSupportName>
<StandaloneGCSupportName>standalonegc-disabled</StandaloneGCSupportName>
<StandaloneGCSupportName Condition="'$(IlcStandaloneGCSupport)' == 'true'">standalonegc-enabled</StandaloneGCSupportName>
<EntryPointSymbol Condition="'$(EntryPointSymbol)' == ''">wmainCRTStartup</EntryPointSymbol>
<LinkerSubsystem Condition="'$(OutputType)' == 'WinExe' and '$(LinkerSubsystem)' == ''">WINDOWS</LinkerSubsystem>
<LinkerSubsystem Condition="'$(OutputType)' == 'Exe' and '$(LinkerSubsystem)' == ''">CONSOLE</LinkerSubsystem>
<EventPipeName>eventpipe-disabled</EventPipeName>
<EventPipeName Condition="'$(EventSourceSupport)' == 'true'">eventpipe-enabled</EventPipeName>
<IlcDefaultStackSize Condition="'$(IlcDefaultStackSize)' == ''">1572864</IlcDefaultStackSize>
</PropertyGroup>
<!-- Ensure that runtime-specific paths have already been set -->
<Target Name="SetupOSSpecificProps" DependsOnTargets="$(IlcDynamicBuildPropertyDependencies)">
<ItemGroup>
<NativeLibrary Condition="'$(NativeLib)' != ''" Include="$(IlcSdkPath)dllmain$(ObjectSuffix)" />
<NativeLibrary Include="$(IlcSdkPath)$(BootstrapperName)$(ObjectSuffix)" />
<NativeLibrary Include="$(IlcSdkPath)$(FullRuntimeName)$(LibrarySuffix)" />
<NativeLibrary Include="$(IlcSdkPath)$(EventPipeName)$(LibrarySuffix)" />
<NativeLibrary Condition="'$(_targetArchitecture)' == 'x64'" Include="$(IlcSdkPath)$(VxSortSupportName)$(LibrarySuffix)" />
<NativeLibrary Condition="'$(IlcMultiModule)' == 'true'" Include="$(SharedLibrary)" />
<NativeLibrary Include="$(IlcSdkPath)$(StandaloneGCSupportName)$(LibrarySuffix)" />
<NativeLibrary Include="$(IlcSdkPath)aotminipal$(LibFileExt)" />
<NativeLibrary Include="$(IlcSdkPath)zlibstatic$(LibFileExt)" />
<NativeLibrary Include="$(IlcSdkPath)brotlicommon$(LibFileExt)" />
<NativeLibrary Include="$(IlcSdkPath)brotlienc$(LibFileExt)" />
<NativeLibrary Include="$(IlcSdkPath)brotlidec$(LibFileExt)" />
</ItemGroup>
<ItemGroup>
<NetCoreAppNativeLibrary Include="System.Globalization.Native" />
<NetCoreAppNativeLibrary Include="System.IO.Compression.Native" />
</ItemGroup>
<ItemGroup>
<DirectPInvoke Include="@(NetCoreAppNativeLibrary->'%(Identity)')" />
<NetCoreAppNativeLibrary Include="@(NetCoreAppNativeLibrary->'%(Identity)')">
<EscapedPath>$(IlcSdkPath)%(Identity).Aot$(LibrarySuffix)</EscapedPath>
</NetCoreAppNativeLibrary>
<NativeLibrary Include="@(NetCoreAppNativeLibrary->'%(EscapedPath)')" />
</ItemGroup>
<ItemGroup>
<SdkNativeLibrary Include="advapi32.lib" />
<SdkNativeLibrary Include="bcrypt.lib" />
<SdkNativeLibrary Include="crypt32.lib" />
<SdkNativeLibrary Include="iphlpapi.lib" />
<SdkNativeLibrary Include="kernel32.lib" />
<SdkNativeLibrary Include="mswsock.lib" />
<SdkNativeLibrary Include="ncrypt.lib" />
<SdkNativeLibrary Include="normaliz.lib" />
<SdkNativeLibrary Include="ntdll.lib" />
<SdkNativeLibrary Include="ole32.lib" />
<SdkNativeLibrary Include="oleaut32.lib" />
<SdkNativeLibrary Include="secur32.lib" />
<SdkNativeLibrary Include="user32.lib" />
<SdkNativeLibrary Include="version.lib" />
<SdkNativeLibrary Include="ws2_32.lib" />
</ItemGroup>
<ItemGroup>
<DirectPInvokeList Include="$(MSBuildThisFileDirectory)WindowsAPIs.txt" />
</ItemGroup>
<ItemGroup>
<LinkerArg Condition="$(IlcMultiModule) != 'true' and $(EnableSourceLink) == 'true' and $(NativeDebugSymbols) == 'true'" Include="/SOURCELINK:$(NativeIntermediateOutputPath)%(ManagedBinary.Filename).sourcelink" />
<LinkerArg Condition="'$(NativeLib)' == 'Shared'" Include="/DLL" />
<LinkerArg Include="@(NativeLibrary->'"%(Identity)"')" />
<LinkerArg Include="@(SdkNativeLibrary->'"%(Identity)"')" />
<LinkerArg Include="/NOLOGO /MANIFEST:NO" />
<LinkerArg Condition="$(IlcMergeSections) != 'false'" Include="/MERGE:.managedcode=.text /MERGE:hydrated=.bss" />
<LinkerArg Condition="$(NativeDebugSymbols) == 'true'" Include="/DEBUG" />
<!-- The runtime is not compatible with jump stubs inserted by incremental linking. -->
<LinkerArg Include="/INCREMENTAL:NO" />
<LinkerArg Condition="'$(NativeLib)' == '' and '$(LinkerSubsystem)' != ''" Include="/SUBSYSTEM:$(LinkerSubsystem)" />
<LinkerArg Condition="'$(NativeLib)' == ''" Include="/ENTRY:$(EntryPointSymbol) /NOEXP /NOIMPLIB /STACK:$(IlcDefaultStackSize)" />
<LinkerArg Include="/NATVIS:"$(MSBuildThisFileDirectory)NativeAOT.natvis"" />
<LinkerArg Condition="'$(ControlFlowGuard)' == 'Guard'" Include="/guard:cf" />
<LinkerArg Condition="'$(_targetArchitecture)' == 'x86'" Include="/safeseh" />
<!-- Do not warn if someone declares UnmanagedCallersOnly with an entrypoint of 'DllGetClassObject' and similar -->
<LinkerArg Include="/IGNORE:4104" />
<!-- Opt into CETCOMPAT by default. -->
<LinkerArg Condition="'$(CETCompat)' != 'false' and '$(_targetArchitecture)' == 'x64'" Include="/CETCOMPAT" />
<!-- Allow user to opt out. -->
<LinkerArg Condition="'$(CETCompat)' == 'false' and '$(_targetArchitecture)' == 'x64'" Include="/CETCOMPAT:NO" />
<!-- Enable EHCONT if CET is not disabled and CFG is enabled. -->
<LinkerArg Condition="'$(CETCompat)' != 'false' and '$(_targetArchitecture)' == 'x64' and '$(ControlFlowGuard)' == 'Guard'" Include="/guard:ehcont"/>
</ItemGroup>
<ItemGroup Condition="!Exists('$(IlcSdkPath)debugucrt.txt')">
<!-- Force ucrt to be dynamically linked for release runtime -->
<LinkerArg Include="/NODEFAULTLIB:libucrt.lib" />
<LinkerArg Include="/DEFAULTLIB:ucrt.lib" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' != 'Debug'">
<LinkerArg Include="/OPT:REF" />
<LinkerArg Include="/OPT:ICF" />
</ItemGroup>
<Exec Condition="'$(IlcUseEnvironmentalTools)' != 'true'" Command=""$(MSBuildThisFileDirectory)findvcvarsall.bat" $(_targetArchitecture)"
IgnoreExitCode="true" ConsoleToMSBuild="true" StandardOutputImportance="Low">
<Output TaskParameter="ConsoleOutput" PropertyName="_FindVCVarsallOutput" />
<Output TaskParameter="ExitCode" PropertyName="_VCVarsAllFound" />
</Exec>
<ItemGroup Condition="'$(_VCVarsAllFound)' == '0'">
<AdditionalNativeLibraryDirectories Include="$(_FindVCVarsallOutput.Split(`#`)[1].Split(';'))" />
</ItemGroup>
<PropertyGroup Condition="'$(_VCVarsAllFound)' == '0'">
<_CppToolsDirectory>$(_FindVCVarsallOutput.Split(`#`)[0])</_CppToolsDirectory>
<CppLinker>$(_CppToolsDirectory)link.exe</CppLinker>
<CppLibCreator>$(_CppToolsDirectory)lib.exe</CppLibCreator>
</PropertyGroup>
<Error Condition="'$(_VCVarsAllFound)' == '1'" Text="Platform linker not found. Ensure you have all the required prerequisites documented at https://aka.ms/nativeaot-prerequisites, in particular the Desktop Development for C++ workload in Visual Studio. For ARM64 development also install C++ ARM64 build tools." />
</Target>
</Project>