Skip to content

Commit b9ead90

Browse files
jkotasmatouskozak
authored andcommitted
Build CoreLib as AnyCPU (dotnet#101084)
Reduce amount of architecture specific code. Minor cleanup motivated by dotnet#101038.
1 parent e8d3893 commit b9ead90

File tree

3 files changed

+3
-22
lines changed

3 files changed

+3
-22
lines changed

src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<PropertyGroup>
4040
<Platform Condition=" '$(Platform)' == '' ">$(TargetArchitecture)</Platform>
4141
<Platform Condition=" '$(Platform)' == 'armel' ">arm</Platform>
42+
<PlatformTarget>AnyCPU</PlatformTarget>
4243
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
4344
<!-- This prevents the default MsBuild targets from referencing System.Core.dll -->
4445
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
@@ -59,28 +60,21 @@
5960

6061
<!-- Platform specific properties -->
6162
<PropertyGroup Condition="'$(Platform)' == 'x64'">
62-
<PlatformTarget>x64</PlatformTarget>
63-
<Prefer32Bit>false</Prefer32Bit>
6463
<DefineConstants>$(DefineConstants);TARGET_AMD64</DefineConstants>
6564
</PropertyGroup>
6665
<PropertyGroup Condition="'$(Platform)' == 'x86'">
67-
<PlatformTarget>x86</PlatformTarget>
6866
<DefineConstants>$(DefineConstants);TARGET_X86</DefineConstants>
6967
</PropertyGroup>
7068
<PropertyGroup Condition="'$(Platform)' == 'arm'">
71-
<PlatformTarget>arm</PlatformTarget>
7269
<DefineConstants>$(DefineConstants);TARGET_ARM</DefineConstants>
7370
</PropertyGroup>
7471
<PropertyGroup Condition="'$(Platform)' == 'arm64'">
75-
<PlatformTarget>AnyCPU</PlatformTarget>
7672
<DefineConstants>$(DefineConstants);TARGET_ARM64</DefineConstants>
7773
</PropertyGroup>
7874
<PropertyGroup Condition="'$(Platform)' == 'loongarch64'">
79-
<PlatformTarget>AnyCPU</PlatformTarget>
8075
<DefineConstants>$(DefineConstants);TARGET_LOONGARCH64</DefineConstants>
8176
</PropertyGroup>
8277
<PropertyGroup Condition="'$(Platform)' == 'riscv64'">
83-
<PlatformTarget>AnyCPU</PlatformTarget>
8478
<DefineConstants>$(DefineConstants);TARGET_RISCV64</DefineConstants>
8579
</PropertyGroup>
8680

src/coreclr/nativeaot/Directory.Build.props

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
<Platform Condition=" '$(Platform)' == '' ">$(TargetArchitecture)</Platform>
2323
<Platform Condition=" '$(Platform)' == 'armel' ">arm</Platform>
24+
<PlatformTarget>AnyCPU</PlatformTarget>
2425
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2526
<!-- This prevents the default MsBuild targets from referencing System.Core.dll -->
2627
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
@@ -78,20 +79,15 @@
7879

7980
<!-- Platform specific properties -->
8081
<PropertyGroup Condition="'$(Platform)' == 'x64'">
81-
<PlatformTarget>x64</PlatformTarget>
82-
<Prefer32Bit>false</Prefer32Bit>
8382
<DefineConstants>TARGET_64BIT;TARGET_AMD64;$(DefineConstants)</DefineConstants>
8483
</PropertyGroup>
8584
<PropertyGroup Condition="'$(Platform)' == 'x86'">
86-
<PlatformTarget>x86</PlatformTarget>
8785
<DefineConstants>TARGET_32BIT;TARGET_X86;$(DefineConstants)</DefineConstants>
8886
</PropertyGroup>
8987
<PropertyGroup Condition="'$(Platform)' == 'arm'">
90-
<PlatformTarget>arm</PlatformTarget>
9188
<DefineConstants>TARGET_32BIT;TARGET_ARM;$(DefineConstants)</DefineConstants>
9289
</PropertyGroup>
9390
<PropertyGroup Condition="'$(Platform)' == 'arm64'">
94-
<PlatformTarget>AnyCPU</PlatformTarget>
9591
<DefineConstants>TARGET_64BIT;TARGET_ARM64;$(DefineConstants)</DefineConstants>
9692
</PropertyGroup>
9793

src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
</ItemGroup>
2727

2828
<PropertyGroup>
29+
<PlatformTarget>AnyCPU</PlatformTarget>
2930
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
3031
<!-- This prevents the default MsBuild targets from referencing System.Core.dll -->
3132
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
@@ -48,40 +49,30 @@
4849

4950
<!-- Platform specific properties -->
5051
<PropertyGroup Condition="'$(Platform)' == 'x64'">
51-
<PlatformTarget>x64</PlatformTarget>
52-
<Prefer32Bit>false</Prefer32Bit>
5352
<DefineConstants>$(DefineConstants);TARGET_AMD64</DefineConstants>
5453
</PropertyGroup>
5554
<PropertyGroup Condition="'$(Platform)' == 'x86'">
56-
<PlatformTarget>x86</PlatformTarget>
5755
<DefineConstants>$(DefineConstants);TARGET_X86</DefineConstants>
5856
</PropertyGroup>
5957
<PropertyGroup Condition="'$(Platform)' == 'armv6'">
60-
<PlatformTarget>arm</PlatformTarget>
6158
<DefineConstants>$(DefineConstants);TARGET_ARMV6</DefineConstants>
6259
</PropertyGroup>
6360
<PropertyGroup Condition="'$(Platform)' == 'arm'">
64-
<PlatformTarget>arm</PlatformTarget>
6561
<DefineConstants>$(DefineConstants);TARGET_ARM</DefineConstants>
6662
</PropertyGroup>
6763
<PropertyGroup Condition="'$(Platform)' == 'arm64'">
68-
<PlatformTarget>AnyCPU</PlatformTarget>
6964
<DefineConstants>$(DefineConstants);TARGET_ARM64</DefineConstants>
7065
</PropertyGroup>
7166
<PropertyGroup Condition="'$(Platform)' == 'riscv64'">
72-
<PlatformTarget>AnyCPU</PlatformTarget>
7367
<DefineConstants>$(DefineConstants);TARGET_RISCV64</DefineConstants>
7468
</PropertyGroup>
7569
<PropertyGroup Condition="'$(Platform)' == 's390x'">
76-
<PlatformTarget>AnyCPU</PlatformTarget>
7770
<DefineConstants>$(DefineConstants);TARGET_S390X</DefineConstants>
7871
</PropertyGroup>
7972
<PropertyGroup Condition="'$(Platform)' == 'wasm'">
80-
<PlatformTarget>AnyCPU</PlatformTarget>
8173
<DefineConstants>$(DefineConstants);TARGET_WASM</DefineConstants>
8274
</PropertyGroup>
8375
<PropertyGroup Condition="'$(Platform)' == 'ppc64le'">
84-
<PlatformTarget>AnyCPU</PlatformTarget>
8576
<DefineConstants>$(DefineConstants);TARGET_POWERPC64</DefineConstants>
8677
</PropertyGroup>
8778

0 commit comments

Comments
 (0)