Skip to content

Commit

Permalink
refa (Laerdal.McuMgr.csproj): refine the way we detect the host opera…
Browse files Browse the repository at this point in the history
…ting system by using the new $([System.OperatingSystem]::Is[Mac/Linux/Windows]OS())
  • Loading branch information
ksidirop-laerdal committed Feb 4, 2025
1 parent 6d8d59b commit 8337c01
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions Laerdal.McuMgr/Laerdal.McuMgr.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<!-- SHARED -->
<!-- ================== HOST MACHINE DETECTION ==================== -->
<PropertyGroup>
<IsHostMachineOSX Condition=" '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true' ">true</IsHostMachineOSX>
<IsHostMachineLinux Condition=" '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true' ">true</IsHostMachineLinux>
<IsHostMachineWindows Condition=" '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true' ">true</IsHostMachineWindows>
<IsHostMachineUnix Condition=" '$(IsHostMachineOSX)' == 'true' OR '$(IsHostMachineLinux)' == 'true' ">true</IsHostMachineUnix>
<IsHostMachineOSX>false</IsHostMachineOSX>
<IsHostMachineOSX Condition=" $([System.OperatingSystem]::IsMacOS()) ">true</IsHostMachineOSX>

<IsHostMachineLinux>false</IsHostMachineLinux>
<IsHostMachineLinux Condition=" $([System.OperatingSystem]::IsLinux()) ">true</IsHostMachineLinux>

<IsHostMachineWindows>false</IsHostMachineWindows>
<IsHostMachineWindows Condition=" $([System.OperatingSystem]::IsWindows()) ">true</IsHostMachineWindows>

<!-- keep dead last -->
<IsHostMachineUnix>false</IsHostMachineUnix>
<IsHostMachineUnix Condition=" $(IsHostMachineOSX) Or $(IsHostMachineLinux) ">true</IsHostMachineUnix>
</PropertyGroup>

<!-- SHARED -->
<PropertyGroup>
<!-- - note that we build against net8.0 merely as a dud-placeholder for windows in which we are bound to get not-implemented exceptions all over the place -->
<!-- - the dud build for net8 also comes in handy when we want to launch an application inside an ios-simulator in the macos desktop (for UI testing purposes) -->
<!-- - also note it only makes sense to build ios stuff under osx because xcodebuild is only available there -->
Expand Down

0 comments on commit 8337c01

Please sign in to comment.