Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 3ad966f

Browse files
eerhardtjkotas
authored andcommitted
Use Vector<T> from System.Private.CoreLib.
Add TypeForwards for Vector<T> in System.Numerics.Vectors to CoreLib when building for netcoreapp.
1 parent 40ef474 commit 3ad966f

File tree

2 files changed

+24
-11
lines changed

2 files changed

+24
-11
lines changed

src/System.Numerics.Vectors/src/Configurations.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
<BuildConfigurations>
1010
uap-Windows_NT;
1111
netfx-Windows_NT;
12-
netcoreapp;
12+
netcoreapp-Windows_NT;
13+
netcoreapp-Unix;
1314
$(PackageConfigurations)
1415
</BuildConfigurations>
1516
</PropertyGroup>
16-
</Project>
17+
</Project>

src/System.Numerics.Vectors/src/System.Numerics.Vectors.csproj

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@
66
<RootNamespace>System.Numerics</RootNamespace>
77
<DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
88
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
9-
<IsPartialFacadeAssembly Condition="'$(TargetGroup)'=='netfx' OR '$(TargetGroup)'=='net46'">true</IsPartialFacadeAssembly>
9+
<IsTargetingNetFx Condition="'$(TargetGroup)'=='netfx' OR '$(TargetGroup)'=='net46'">true</IsTargetingNetFx>
10+
<IsTargetingNetCoreApp Condition="'$(TargetGroup)'=='netcoreapp'">true</IsTargetingNetCoreApp>
11+
<IsPartialFacadeAssembly Condition="'$(IsTargetingNetFx)'=='true' OR '$(IsTargetingNetCoreApp)'=='true'">true</IsPartialFacadeAssembly>
1012
<PackageTargetFramework Condition="'$(TargetGroup)' == 'netstandard1.0'">netstandard1.0;portable-net45+win8+wp8+wpa81</PackageTargetFramework>
1113
</PropertyGroup>
1214
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net46-Debug|AnyCPU'" />
1315
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net46-Release|AnyCPU'" />
14-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
15-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
16+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" />
17+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Release|AnyCPU'" />
18+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
19+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Release|AnyCPU'" />
1620
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Windows_NT-Debug|AnyCPU'" />
1721
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Windows_NT-Release|AnyCPU'" />
1822
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
@@ -26,15 +30,18 @@
2630
<Compile Include="$(CommonPath)\System\Numerics\Hashing\HashHelpers.cs">
2731
<Link>Common\System\Numerics\Hashing\HashHelpers.cs</Link>
2832
</Compile>
33+
<Compile Include="$(CommonPath)\CoreLib\System\Runtime\CompilerServices\IntrinsicAttribute.cs">
34+
<Link>System\Runtime\CompilerServices\IntrinsicAttribute.cs</Link>
35+
</Compile>
36+
</ItemGroup>
37+
<!-- On .NET Core, Vector<T> is in System.Private.CoreLib -->
38+
<ItemGroup Condition="'$(IsTargetingNetCoreApp)' != 'true'">
2939
<Compile Include="$(CommonPath)\CoreLib\System\Numerics\ConstantHelper.cs">
3040
<AutoGen>True</AutoGen>
3141
<DesignTime>True</DesignTime>
3242
<DependentUpon>ConstantHelper.tt</DependentUpon>
3343
<Link>System\Numerics\ConstantHelper.cs</Link>
3444
</Compile>
35-
<Compile Include="$(CommonPath)\CoreLib\System\Runtime\CompilerServices\IntrinsicAttribute.cs">
36-
<Link>System\Runtime\CompilerServices\IntrinsicAttribute.cs</Link>
37-
</Compile>
3845
<Compile Include="$(CommonPath)\CoreLib\System\Numerics\Register.cs">
3946
<AutoGen>True</AutoGen>
4047
<DesignTime>True</DesignTime>
@@ -52,13 +59,13 @@
5259
</Compile>
5360
</ItemGroup>
5461
<!-- Carry a copy of MathF where not available -->
55-
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' == 'true' OR $(TargetGroup.StartsWith('netstandard'))">
62+
<ItemGroup Condition="'$(IsTargetingNetFx)' == 'true' OR $(TargetGroup.StartsWith('netstandard'))">
5663
<Compile Include="$(CommonPath)\System\MathF.netstandard.cs">
5764
<Link>System\MathF.netstandard.cs</Link>
5865
</Compile>
5966
</ItemGroup>
6067
<!-- Portable version only -->
61-
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' != 'true'">
68+
<ItemGroup Condition="'$(IsTargetingNetFx)' != 'true'">
6269
<Compile Include="System\Numerics\Matrix3x2.cs" />
6370
<Compile Include="System\Numerics\Matrix4x4.cs" />
6471
<Compile Include="System\Numerics\Plane.cs" />
@@ -70,7 +77,7 @@
7077
<Compile Include="System\Numerics\Vector4.cs" />
7178
<Compile Include="System\Numerics\Vector4_Intrinsics.cs" />
7279
</ItemGroup>
73-
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' == 'true'">
80+
<ItemGroup Condition="'$(IsTargetingNetFx)' == 'true'">
7481
<Reference Include="mscorlib" />
7582
<Reference Include="System.Numerics" />
7683
</ItemGroup>
@@ -93,6 +100,11 @@
93100
<LastGenOutput>Vector.cs</LastGenOutput>
94101
<Link>System\Numerics\Vector.tt</Link>
95102
</Content>
103+
</ItemGroup>
104+
<ItemGroup Condition="'$(IsTargetingNetCoreApp)' == 'true'">
105+
<ReferenceFromRuntime Include="System.Private.CoreLib" />
106+
</ItemGroup>
107+
<ItemGroup Condition="'$(IsTargetingNetCoreApp)' != 'true'">
96108
<Reference Include="System.Diagnostics.Tools" />
97109
<Reference Include="System.Globalization" />
98110
<Reference Include="System.Resources.ResourceManager" />

0 commit comments

Comments
 (0)