-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.ps1
42 lines (35 loc) · 1007 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
36
37
38
39
40
41
42
$BuildArch = "x64"
$BuildConfig = "Release"
$BuildPlatform = "x64"
$buildPath
$libsFolder
$rootFolder = (Get-Location).ToString()
#This makes possible to run the script from the root git folder
if((Get-Item .).Name -ne "native")
{
#it means we are at the root folder
$buildPath = Join-Path $rootFolder "native" "build"
$libsFolder = Join-Path $rootFolder "libs"
}
else
{
$buildPath = Join-Path $rootFolder "build"
$libsFolder = Join-Path $rootFolder ".." "libs"
}
#Clean the folder if exists, if not creates a new one
if (Test-Path -Path $buildPath) {
Remove-Item -Path $buildPath -Recurse -Force
mkdir $buildPath
}
else {
mkdir $buildPath
}
#Enters build folder
Push-Location $buildPath
cmake .\..
cmake --build . --config $BuildConfig
Pop-Location
#copy the file to the output folder
$releasePath = Join-Path $buildPath $BuildConfig
#TODO cope the file to the output folder
Copy-Item -Path "$releasePath\*.dll" -Destination "$libsFolder\win-x64\cimgui.dll" -PassThru