-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.ps1
51 lines (41 loc) · 953 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
43
44
45
46
47
48
49
50
51
param(
[switch]$development=$false,
[switch]$headless=$false,
[switch]$clean=$false,
[string]$projectName
)
if (-Not (Test-Path Engine/_Bin -PathType Container)) {
mkdir Engine/_Bin;
}
if ($clean) {
rm -r -force Engine/_Bin/; mkdir Engine/_Bin;
}
cd Engine/_Bin;
$exec = 'cmake -G "Visual Studio 16 2019"'
if ($development) {
$exec = "$exec -DDEVELOPMENT=ON"
}
if ($headless) {
$exec = "$exec -DHEADLESS=ON"
}
if ($projectName) {
$exec = "$exec -DUSER_PROJECT_NAME=$projectName"
}
Invoke-Expression "$exec ../..;"
if (Get-Command "devenv.com" -ErrorAction SilentlyContinue) {
Invoke-Expression "devenv.com Zenith.sln /build"
}
if ($projectName) {
cd ../../$projectName
if (-Not (Test-Path ./Build -PathType Container)) {
mkdir Build;
}
if ($clean) {
rm -r -force Build; mkdir Build;
}
cd Build;
Invoke-Expression "$exec ../"
explorer .; cd ..;
} else {
explorer .; cd ../..;
}