This repository has been archived by the owner on Aug 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pack.ps1
37 lines (31 loc) · 1.25 KB
/
pack.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
param ([string] $Os, [string] $TargetDir = "../target/release")
Push-Location $PSScriptRoot
$packageDir = "$TargetDir/c"
$includeDir = "$packageDir/include"
$binDir = "$packageDir/bin"
$libDir = "$packageDir/lib"
$examplesDir = "$packageDir/examples"
New-Item -Path $packageDir -ItemType Directory
New-Item -Path $includeDir -ItemType Directory
New-Item -Path $binDir -ItemType Directory
New-Item -Path $libDir -ItemType Directory
New-Item -Path $examplesDir -ItemType Directory
Copy-Item "./include/spotflow.h" $includeDir
Copy-Item "./packaging/get_started.c" $examplesDir
if ($Os -Eq "Windows") {
Copy-Item "$TargetDir/spotflow.dll" $binDir
Copy-Item "$TargetDir/spotflow.dll.lib" $libDir
Copy-Item "$TargetDir/spotflow.lib" $libDir
Copy-Item "./packaging/projects_x64/vs2022_*" $examplesDir -Recurse
} elseif ($Os -Eq "macOS") {
Copy-Item "$TargetDir/libspotflow.dylib" $binDir
Copy-Item "$TargetDir/libspotflow.a" $libDir
Copy-Item "./packaging/projects/clang_*" $examplesDir -Recurse
} elseif ($Os -Eq "Linux") {
Copy-Item "$TargetDir/libspotflow.so" $binDir
Copy-Item "$TargetDir/libspotflow.a" $libDir
Copy-Item "./packaging/projects/gcc_*" $examplesDir -Recurse
} else {
Write-Error "Unknown OS: $Os"
}
Pop-Location