Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dotnet-install.sh
dotnet-uninstall-pkgs.sh
src/powershell-unix
10 changes: 6 additions & 4 deletions .vsts-ci/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ variables:
resources:
- repo: self
clean: true
phases:
- phase: Build

queue:
name: Hosted macOS
jobs:
- job: Build

pool:
vmImage: macOs-latest

steps:
- powershell: |
tools/releaseBuild/PowershellNative.ps1 -Arch osx -Configuration Release -RepoRoot $(Build.SourcesDirectory) -TargetLocation "$(System.ArtifactsDirectory)/Packages" -Verbose
Expand Down
17 changes: 16 additions & 1 deletion build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@ function Start-BuildNativeUnixBinaries {
Start-NativeExecution { cmake -DCMAKE_TOOLCHAIN_FILE="./arm64.toolchain.cmake" . }
Start-NativeExecution { make -j }
}
elseif ($IsMacOS) {
Start-NativeExecution { cmake -DCMAKE_TOOLCHAIN_FILE="./macos.toolchain.cmake" . }
Start-NativeExecution { make -j }
Start-NativeExecution { ctest --verbose }
}
else {
Start-NativeExecution { cmake -DCMAKE_BUILD_TYPE=Debug . }
Start-NativeExecution { make -j }
Expand Down Expand Up @@ -774,6 +779,7 @@ function Start-PSBuild {
# If this parameter is not provided it will get determined automatically.
[ValidateSet("win7-x64",
"win7-x86",
"osx-arm64",
"osx-x64",
"linux-x64",
"linux-arm",
Expand Down Expand Up @@ -1087,6 +1093,7 @@ function New-PSOptions {
[ValidateSet("",
"win7-x86",
"win7-x64",
"osx-arm64",
"osx-x64",
"linux-x64",
"linux-arm",
Expand Down Expand Up @@ -1139,7 +1146,12 @@ function New-PSOptions {
if ($Environment.IsLinux) {
$Runtime = "linux-x64"
} elseif ($Environment.IsMacOS) {
$Runtime = "osx-x64"
if ($PSVersionTable.OS.Contains('ARM64')) {
$Runtime = "osx-arm64"
}
else {
$Runtime = "osx-x64"
}
} else {
$RID = dotnet --info | ForEach-Object {
if ($_ -match "RID") {
Expand Down Expand Up @@ -2540,6 +2552,7 @@ function Start-CrossGen {
[Parameter(Mandatory=$true)]
[ValidateSet("win7-x86",
"win7-x64",
"osx-arm64",
"osx-x64",
"linux-x64",
"linux-arm",
Expand Down Expand Up @@ -2610,6 +2623,8 @@ function Start-CrossGen {
throw "crossgen is not available for 'linux-arm64'"
} elseif ($Environment.IsLinux) {
"linux-x64"
} elseif ($Runtime -eq "osx-arm64") {
"osx-arm64"
} elseif ($Environment.IsMacOS) {
"osx-x64"
}
Expand Down
13 changes: 13 additions & 0 deletions src/libpsl-native/macos.toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.19)
SET(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "" FORCE)

add_compile_options(-g -mmacosx-version-min=10.9)

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
3 changes: 2 additions & 1 deletion tools/releaseBuild/yaml/releaseBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ stages:

- job: BuildMac
displayName: Build Native Binaries on macOS
pool: Hosted Mac Internal
pool:
vmImage: macOS-Latest
steps:
- template: mac.yml

Expand Down