Skip to content

Commit 7ead57c

Browse files
Replace .NET RuntimeInformation platform detection in build.ps1 (closes #221)
1 parent 9a7f2d3 commit 7ead57c

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

build.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,16 @@ if ($runtimeSources.Count -eq 0) {
7777
exit 1
7878
}
7979

80-
$platform = [System.Runtime.InteropServices.RuntimeInformation]
8180
$extSuffix = ".dll"
82-
if ($platform::IsOSPlatform([System.Runtime.InteropServices.OSPlatform]::Linux)) {
81+
if ($IsLinux) {
8382
$extSuffix = ".so"
84-
} elseif ($platform::IsOSPlatform([System.Runtime.InteropServices.OSPlatform]::OSX)) {
83+
} elseif ($IsMacOS) {
8584
$extSuffix = ".dylib"
8685
}
8786

8887
Push-Location $buildDir
8988
try {
90-
$runningOnWindows = $platform::IsOSPlatform([System.Runtime.InteropServices.OSPlatform]::Windows)
89+
$runningOnWindows = -not $IsLinux -and -not $IsMacOS
9190

9291
# Use a single release profile for every artifact: portable baseline x64,
9392
# full-program optimization, and link-time dead stripping/folding.

0 commit comments

Comments
 (0)