-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
compile-native.proj
45 lines (39 loc) · 2.97 KB
/
compile-native.proj
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
<Project Sdk="Microsoft.Build.Traversal">
<PropertyGroup>
<!-- we always want to make shared libs -->
<NativeLibKind Condition="'$(NativeLibKind)' == ''">shared</NativeLibKind>
<!-- When we publish, we want to ensure the SDK does the same thing as though we ran 'dotnet publish' -->
<TraversalPublishGlobalProperties>$(TraversalPublishGlobalProperties);_IsPublishing=true</TraversalPublishGlobalProperties>
</PropertyGroup>
<ItemGroup>
<!-- add new projects here -->
<!-- NativeLibsProjectsToBuild Include="$(MSBuildThisFileDirectory)libhellomanaged/src/libhellomanaged.csproj" -->
<NativeLibsProjectsToBuild Include="$(MSBuildThisFileDirectory)cdacreader/src/cdacreader.csproj" />
</ItemGroup>
<!-- Decide if we're going to do the NativeAOT builds -->
<PropertyGroup>
<!-- disable on Mono, for now -->
<SupportsNativeAotComponents Condition="'$(SupportsNativeAotComponents)' == '' and '$(RuntimeFlavor)' == 'Mono'">false</SupportsNativeAotComponents>
<!-- disable on linux-bionic, for now -->
<SupportsNativeAotComponents Condition="'$(SupportsNativeAotComponents)' == '' and '$(TargetsLinuxBionic)' == 'true'">false</SupportsNativeAotComponents>
<!-- NativeAOT doesn't support cross-OS compilation. disable for crossdac-->
<SupportsNativeAotComponents Condition="'$(SupportsNativeAotComponents)' == '' and '$(HostOS)' != '$(TargetOS)'">false</SupportsNativeAotComponents>
<!-- unsupported targets -->
<SupportsNativeAotComponents Condition="'$(SupportsNativeAotComponents)' == '' and '$(DotNetBuildSourceOnly)' == 'true'">false</SupportsNativeAotComponents>
<SupportsNativeAotComponents Condition="'$(SupportsNativeAotComponents)' == '' and ('$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'armel' or '$(TargetArchitecture)' == 'x86' or '$(TargetArchitecture)' == 'riscv64')">false</SupportsNativeAotComponents>
<SupportsNativeAotComponents Condition="'$(SupportsNativeAotComponents)' == '' and ('$(TargetsWindows)' == 'true' or '$(TargetsOSX)' == 'true' or ('$(TargetsLinux)' == 'true' and '$(TargetsAndroid)' != 'true' and '$(TargetsLinuxMusl)' != 'true'))">true</SupportsNativeAotComponents>
<SupportsNativeAotComponents Condition="'$(SupportsNativeAotComponents)' == ''">false</SupportsNativeAotComponents>
</PropertyGroup>
<ItemGroup>
<!-- additional native compilation-specific properties to pass down to the ProjectReference -->
<SubprojectProps Include="NativeLib" Value="$(NativeLibKind)"/>
</ItemGroup>
<Import Project=".\subproject.props" />
<ItemGroup>
<ProjectReference Include="@(NativeLibsProjectsToBuild)"
ReferenceOutputAssembly="false"
AdditionalProperties="%(AdditionalProperties);$(SplitSubprojectProps)"
Targets="Publish"
Condition="$(SupportsNativeAotComponents)"/>
</ItemGroup>
</Project>