-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change current architecture as default platform
- Loading branch information
Showing
3 changed files
with
30 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Nuke.Common.Tools.MSBuild; | ||
using System.Runtime.InteropServices; | ||
|
||
partial class Build | ||
{ | ||
private static string AndFilter(params string[] args) | ||
{ | ||
return string.Join("&", args.Where(s => !string.IsNullOrEmpty(s))); | ||
} | ||
|
||
private static MSBuildTargetPlatform GetDefaultTargetPlatform() | ||
{ | ||
if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64) | ||
{ | ||
return Arm64TargetPlatform; | ||
} | ||
|
||
if (RuntimeInformation.OSArchitecture == Architecture.X86) | ||
{ | ||
return MSBuildTargetPlatform.x86; | ||
} | ||
|
||
return MSBuildTargetPlatform.x64; | ||
} | ||
|
||
private static MSBuildTargetPlatform Arm64TargetPlatform = (MSBuildTargetPlatform)"arm64"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters