Skip to content

Commit

Permalink
binplace other build output to artifacts path
Browse files Browse the repository at this point in the history
  • Loading branch information
nigriMSFT committed Apr 17, 2024
1 parent 50ed605 commit de4c0e2
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,12 @@ if ($Clean) {
if (!(Test-Path $BaseArtifactsDir)) {
New-Item -Path $BaseArtifactsDir -ItemType Directory -Force | Out-Null
}
if (!(Test-Path $BuildDir)) { New-Item -Path $BuildDir -ItemType Directory -Force | Out-Null }
if (!(Test-Path $ArtifactsDir)) {
New-Item -Path $ArtifactsDir -ItemType Directory -Force | Out-Null
}
if (!(Test-Path $BuildDir)) {
New-Item -Path $BuildDir -ItemType Directory -Force | Out-Null
}

if ($Clang) {
if ($IsWindows) {
Expand Down Expand Up @@ -368,6 +373,25 @@ function CMake-Build {

Log "Running: $Arguments"
CMake-Execute $Arguments

if ($IsWindows) {
Copy-Item (Join-Path $BuildDir "obj" $Config "$LibraryName.lib") $ArtifactsDir
} elseif ($IsLinux -and $OneBranch) {
# archive the build artifacts for packaging to persist symlinks and permissons.
$ArtifactsParentDir = Split-Path $ArtifactsDir -Parent
$ArtifactsLeafDir = Split-Path $ArtifactsDir -Leaf
tar -cvf "$ArtifactsDir.tar" -C $ArtifactsParentDir "./$ArtifactsLeafDir"
}

# Package debug symbols on macos
if ($Platform -eq "macos") {
$BuiltArtifacts = Get-ChildItem $ArtifactsDir -File
foreach ($Artifact in $BuiltArtifacts) {
if (Test-Path $Artifact) {
dsymutil $Artifact
}
}
}
}

##############################################################
Expand Down

0 comments on commit de4c0e2

Please sign in to comment.