|
13 | 13 | <EnableWindowsTargeting>true</EnableWindowsTargeting> |
14 | 14 | </PropertyGroup> |
15 | 15 |
|
16 | | - <PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).StartsWith('win')) OR $([MSBuild]::IsOSPlatform('Windows'))"> |
| 16 | + <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))"> |
17 | 17 | <IsWindows>true</IsWindows> |
18 | 18 | <DefineConstants>$(DefineConstants);WINDOWS;IsWindows</DefineConstants> |
19 | 19 | </PropertyGroup> |
20 | 20 |
|
21 | | - <PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).StartsWith('linux')) OR $([MSBuild]::IsOSPlatform('Linux'))"> |
| 21 | + <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))"> |
22 | 22 | <IsLinux>true</IsLinux> |
23 | 23 | <DefineConstants>$(DefineConstants);LINUX;IsLinux</DefineConstants> |
24 | 24 | </PropertyGroup> |
25 | 25 |
|
26 | | - <PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).StartsWith('osx')) OR $([MSBuild]::IsOSPlatform('OSX'))"> |
| 26 | + <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))"> |
27 | 27 | <IsOSX>true</IsOSX> |
28 | 28 | <IsMacOS>true</IsMacOS> |
29 | 29 | <DefineConstants>$(DefineConstants);OSX;MACOS;IsOSX;IsMacOS</DefineConstants> |
30 | 30 | </PropertyGroup> |
31 | 31 |
|
32 | | - <PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).StartsWith('ios'))"> |
33 | | - <IsIOS>true</IsIOS> |
34 | | - <DefineConstants>$(DefineConstants);IOS;IsIOS</DefineConstants> |
35 | | - </PropertyGroup> |
36 | | - |
37 | | - <PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).StartsWith('android'))"> |
38 | | - <IsAndroid>true</IsAndroid> |
39 | | - <DefineConstants>$(DefineConstants);ANDROID;IsAndroid</DefineConstants> |
40 | | - </PropertyGroup> |
41 | | - |
42 | | - <PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).StartsWith('maccatalyst'))"> |
43 | | - <IsMacCatalyst>true</IsMacCatalyst> |
44 | | - <DefineConstants>$(DefineConstants);MACCATALYST;IsMacCatalyst</DefineConstants> |
45 | | - </PropertyGroup> |
46 | | - |
47 | | - <PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).StartsWith('browser'))"> |
48 | | - <IsBrowser>true</IsBrowser> |
49 | | - <IsWasm>true</IsWasm> |
50 | | - <DefineConstants>$(DefineConstants);BROWSER;WASM;IsBrowser;IsWasm</DefineConstants> |
| 32 | + <PropertyGroup> |
| 33 | + <_OSArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)</_OSArchitecture> |
51 | 34 | </PropertyGroup> |
52 | 35 |
|
53 | | - <PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).Contains('x64')) OR $([System.String]::Copy($(RuntimeIdentifier)).Contains('win-x64'))"> |
| 36 | + <PropertyGroup Condition="'$(_OSArchitecture)' == 'X64'"> |
54 | 37 | <IsX64>true</IsX64> |
55 | 38 | <DefineConstants>$(DefineConstants);X64;IsX64</DefineConstants> |
56 | 39 | </PropertyGroup> |
57 | 40 |
|
58 | | - <PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).Contains('x86')) OR $([System.String]::Copy($(RuntimeIdentifier)).Contains('win-x86'))"> |
| 41 | + <PropertyGroup Condition="'$(_OSArchitecture)' == 'X86'"> |
59 | 42 | <IsX86>true</IsX86> |
60 | 43 | <DefineConstants>$(DefineConstants);X86;IsX86</DefineConstants> |
61 | 44 | </PropertyGroup> |
62 | 45 |
|
63 | | - <PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).Contains('arm64'))"> |
| 46 | + <PropertyGroup Condition="'$(_OSArchitecture)' == 'Arm64'"> |
64 | 47 | <IsARM64>true</IsARM64> |
65 | 48 | <DefineConstants>$(DefineConstants);ARM64;IsARM64</DefineConstants> |
66 | 49 | </PropertyGroup> |
67 | 50 |
|
68 | | - <PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).Contains('arm')) AND !$([System.String]::Copy($(RuntimeIdentifier)).Contains('arm64'))"> |
| 51 | + <PropertyGroup Condition="'$(_OSArchitecture)' == 'Arm'"> |
69 | 52 | <IsARM>true</IsARM> |
70 | 53 | <DefineConstants>$(DefineConstants);ARM;IsARM</DefineConstants> |
71 | 54 | </PropertyGroup> |
72 | 55 |
|
73 | | - <PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).StartsWith('ios')) OR $([System.String]::Copy($(RuntimeIdentifier)).StartsWith('android'))"> |
74 | | - <IsMobile>true</IsMobile> |
75 | | - <DefineConstants>$(DefineConstants);MOBILE;IsMobile</DefineConstants> |
76 | | - </PropertyGroup> |
77 | | - |
78 | | - <PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).StartsWith('win')) OR $([System.String]::Copy($(RuntimeIdentifier)).StartsWith('linux')) OR $([System.String]::Copy($(RuntimeIdentifier)).StartsWith('osx'))"> |
| 56 | + <PropertyGroup Condition="'$(IsWindows)' == 'true' OR '$(IsLinux)' == 'true' OR '$(IsOSX)' == 'true'"> |
79 | 57 | <IsDesktop>true</IsDesktop> |
80 | 58 | <DefineConstants>$(DefineConstants);DESKTOP;IsDesktop</DefineConstants> |
81 | 59 | </PropertyGroup> |
82 | 60 |
|
83 | | - <PropertyGroup Condition="$([System.String]::Copy($(RuntimeIdentifier)).StartsWith('linux')) OR $([System.String]::Copy($(RuntimeIdentifier)).StartsWith('osx'))"> |
| 61 | + <PropertyGroup Condition="'$(IsLinux)' == 'true' OR '$(IsOSX)' == 'true'"> |
84 | 62 | <IsUnix>true</IsUnix> |
85 | 63 | <DefineConstants>$(DefineConstants);UNIX;IsUnix</DefineConstants> |
86 | 64 | </PropertyGroup> |
|
0 commit comments