-
Notifications
You must be signed in to change notification settings - Fork 2
/
pipeline.ps1
70 lines (59 loc) · 1.76 KB
/
pipeline.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
[CmdletBinding()]
Param(
[Parameter(Mandatory = $False)]
[switch]$generate,
[Parameter(Mandatory = $False)]
[switch]$update,
[Parameter(Mandatory = $False)]
[switch]$compile,
[Parameter(Mandatory = $False)]
[switch]$build,
[Parameter(Mandatory = $False)]
[switch]$win32,
[Parameter(Mandatory = $False)]
[switch]$uwp,
[Parameter(Mandatory = $False)]
[switch]$release
)
$Cmake = "cmake.exe"
$BuildDirectory = ""
$PlatformParameters = ""
$Generator = "Visual Studio 17 2022"
$BuildType = ""
$BuildConfiguration = "Debug"
If($win32) {
$BuildDirectory = "build/win32"
} ElseIf($uwp) {
$BuildDirectory = "build/uwp"
$PlatformParameters = @("-DCMAKE_SYSTEM_NAME='WindowsStore'", "-DCMAKE_SYSTEM_VERSION='10.0.22000.0'")
}
If($release) {
If($win32) {
$BuildType = "-DCMAKE_CONFIGURATION_TYPES=Release"
$BuildConfiguration = "Release"
} ElseIf($uwp) {
$BuildType = "-DCMAKE_CONFIGURATION_TYPES=RelWithDebInfo"
$BuildConfiguration = "RelWithDebInfo"
}
} Else {
$BuildType = "-DCMAKE_BUILD_TYPE=Debug"
$BuildDirectory += "-debug"
}
if($generate -OR $build) {
& $Cmake @("-E", "remove_directory", $BuildDirectory)
& $Cmake @("-E", "make_directory", $BuildDirectory)
}
if($generate -OR $build -OR $update) {
$GenerateParameters = @("-E", "chdir", $BuildDirectory, "cmake", "-G", $Generator)
$GenerateParameters += $PlatformParameters
$GenerateParameters += $BuildType
$GenerateParameters += ("-A", "x64", "../..")
& $Cmake $GenerateParameters
if($uwp) {
$InjectCommand = $BuildDirectory + "/inject.py"
& python @($InjectCommand)
}
}
if($compile -OR $build) {
& $Cmake @("--build", $BuildDirectory, "--config", $BuildConfiguration)
}