forked from Tatenshi/RecentlyPlayed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
35 lines (28 loc) · 752 Bytes
/
build.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
Param(
[Parameter(Mandatory=$false)]
[Switch] $clean,
[Parameter(Mandatory=$false)]
[Switch] $help
)
if ($help -eq $true) {
echo "`"Build`" - Copiles your mod into a `".so`" or a `".a`" library"
echo "`n-- Arguments --`n"
echo "-Clean `t`t Deletes the `"build`" folder, so that the entire library is rebuilt"
exit
}
# if user specified clean, remove all build files
if ($clean.IsPresent)
{
if (Test-Path -Path "build")
{
remove-item build -R
}
}
if (($clean.IsPresent) -or (-not (Test-Path -Path "build")))
{
$out = new-item -Path build -ItemType Directory
}
& cmake -G "Ninja" -DCMAKE_BUILD_TYPE="RelWithDebInfo" -B build
& cmake --build ./build
$ExitCode = $LastExitCode
exit $ExitCode