Skip to content

Commit a1f0138

Browse files
committed
🎨 macos sample
1 parent 8ac31b4 commit a1f0138

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Avalonia.WebView2.Sample/Avalonia.WebView2.Sample.csproj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
<TargetFrameworks>net9.0-windows;net9.0</TargetFrameworks>
1212
</PropertyGroup>
1313
</When>
14+
<!-- 👇 在 macOS 上开发 -->
15+
<When Condition="$([System.OperatingSystem]::IsMacOS())">
16+
<PropertyGroup>
17+
<TargetFrameworks>net9.0-macos</TargetFrameworks>
18+
</PropertyGroup>
19+
</When>
20+
<!-- 👇 在 Linux 上开发 -->
1421
<Otherwise>
1522
<PropertyGroup>
1623
<TargetFrameworks>net9.0</TargetFrameworks>
@@ -31,6 +38,12 @@
3138
<ProjectReference Include="..\Avalonia.Ref\Avalonia.X11\Avalonia.X11.csproj" />
3239
</ItemGroup>
3340
</When>
41+
<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'macos'">
42+
<ItemGroup>
43+
<PackageReference Include="Avalonia.Desktop" />
44+
<PackageReference Include="Avalonia.Native" />
45+
</ItemGroup>
46+
</When>
3447
<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == ''">
3548
<ItemGroup>
3649
<PackageReference Include="Avalonia.Desktop" />

0 commit comments

Comments
 (0)