Skip to content

Commit 13d8cec

Browse files
ds5678xen2
authored andcommitted
Improve StridePlatform detection
1 parent 6e2f185 commit 13d8cec

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

build/Stride.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<StrideCommonPreSettingsName>Stride</StrideCommonPreSettingsName>
55
<StridePlatforms Condition="'$(StridePlatforms)' == '' And '$([MSBuild]::IsOSPlatform(Windows))'">Windows</StridePlatforms>
6+
<StridePlatforms Condition="'$(StridePlatforms)' == '' And '$([MSBuild]::IsOSPlatform(OSX))'">macOS</StridePlatforms>
67
<StridePlatforms Condition="'$(StridePlatforms)' == '' And '$([MSBuild]::IsOSPlatform(Linux))'">Linux</StridePlatforms>
78
</PropertyGroup>
89
<PropertyGroup Condition="'$(StridePlatform)' == 'Windows'">

sources/core/Stride.Core/build/Stride.Core.targets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@
4040
-->
4141
<PropertyGroup>
4242
<!-- Default mappings -->
43+
<StridePlatform Condition="'$(StridePlatform)' == '' And '$(TargetPlatformIdentifier)' == 'Windows'">Windows</StridePlatform>
44+
<StridePlatform Condition="'$(StridePlatform)' == '' And '$(TargetPlatformIdentifier)' == 'macOS'">macOS</StridePlatform>
4345
<StridePlatform Condition="'$(StridePlatform)' == '' And '$(TargetPlatformIdentifier)' == 'UAP'">UWP</StridePlatform>
4446
<StridePlatform Condition="'$(StridePlatform)' == '' And '$(TargetPlatformIdentifier)' == 'Android'">Android</StridePlatform>
4547
<StridePlatform Condition="'$(StridePlatform)' == '' And '$(TargetPlatformIdentifier)' == 'iOS'">iOS</StridePlatform>
46-
<StridePlatform Condition="'$(StridePlatform)' == '' And '$(TargetPlatformIdentifier)' == 'macOS'">macOS</StridePlatform>
48+
<StridePlatform Condition="'$(StridePlatform)' == '' And $(RuntimeIdentifier.StartsWith('osx'))">macOS</StridePlatform>
4749
<StridePlatform Condition="'$(StridePlatform)' == '' And $(RuntimeIdentifier.StartsWith('linux'))">Linux</StridePlatform>
4850
<StridePlatform Condition="'$(StridePlatform)' == ''">Windows</StridePlatform>
4951
</PropertyGroup>

sources/targets/Stride.Core.props

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,29 @@
99
<PropertyGroup>
1010
<StrideFramework>net10.0</StrideFramework>
1111
<StrideFrameworkWindows>net10.0-windows</StrideFrameworkWindows>
12+
<StrideFrameworkmacOS>net10.0-macos</StrideFrameworkmacOS>
1213
<StrideFrameworkAndroid>net10.0-android</StrideFrameworkAndroid>
1314
<StrideFrameworkiOS>net10.0-ios</StrideFrameworkiOS>
1415
<StrideFrameworkUWP>uap10.0.16299</StrideFrameworkUWP>
1516

1617
<!-- Default values -->
1718
<StridePlatformOriginal>$(StridePlatform)</StridePlatformOriginal>
18-
<StridePlatform>Windows</StridePlatform>
19-
<StridePlatform Condition=" '$([MSBuild]::IsOSPlatform(Linux))' Or '$(RuntimeIdentifier.StartsWith(linux))' ">Linux</StridePlatform>
20-
<StridePlatform Condition=" $(RuntimeIdentifier.StartsWith('osx')) ">macOS</StridePlatform>
19+
<StridePlatform></StridePlatform>
20+
<StridePlatform Condition=" '$(RuntimeIdentifier.StartsWith(win))' ">Windows</StridePlatform>
21+
<StridePlatform Condition=" '$(RuntimeIdentifier.StartsWith(osx))' ">macOS</StridePlatform>
22+
<StridePlatform Condition=" '$(RuntimeIdentifier.StartsWith(linux))' ">Linux</StridePlatform>
23+
<StridePlatform Condition=" '$(TargetFramework)' == '$(StrideFrameworkWindows)' ">Windows</StridePlatform>
24+
<StridePlatform Condition=" '$(TargetFramework)' == '$(StrideFrameworkmacOS)' ">macOS</StridePlatform>
2125
<StridePlatform Condition=" '$(TargetFramework)' == '$(StrideFrameworkUWP)' ">UWP</StridePlatform>
2226
<StridePlatform Condition=" '$(TargetFramework)' == '$(StrideFrameworkAndroid)' ">Android</StridePlatform>
2327
<StridePlatform Condition=" '$(TargetFramework)' == '$(StrideFrameworkiOS)' ">iOS</StridePlatform>
28+
<StridePlatform Condition=" '$(StridePlatform)' == '' And '$([MSBuild]::IsOSPlatform(Linux))' ">Linux</StridePlatform>
29+
<StridePlatform Condition=" '$(StridePlatform)' == '' And '$([MSBuild]::IsOSPlatform(OSX))' ">macOS</StridePlatform>
30+
<StridePlatform Condition=" '$(StridePlatform)' == '' ">Windows</StridePlatform>
2431

2532
<StridePlatformFullName Condition="'$(StridePlatformFullName)' == ''">$(StridePlatform)</StridePlatformFullName>
2633

27-
<StridePlatformDeps Condition=" '$(TargetFramework)' == '$(StrideFramework)' Or '$(TargetFramework)' == '$(StrideFrameworkWindows)' ">dotnet</StridePlatformDeps>
34+
<StridePlatformDeps Condition=" '$(TargetFramework)' == '$(StrideFramework)' Or '$(TargetFramework)' == '$(StrideFrameworkWindows)' Or '$(TargetFramework)' == '$(StrideFrameworkmacOS)' ">dotnet</StridePlatformDeps>
2835
<StridePlatformDeps Condition=" '$(TargetFramework)' == '$(StrideFrameworkUWP)' ">UWP</StridePlatformDeps>
2936
<StridePlatformDeps Condition=" '$(TargetFramework)' == '$(StrideFrameworkAndroid)' ">Android</StridePlatformDeps>
3037
<StridePlatformDeps Condition=" '$(TargetFramework)' == '$(StrideFrameworkiOS)' ">iOS</StridePlatformDeps>

0 commit comments

Comments
 (0)