-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfigure.ps1
More file actions
73 lines (60 loc) · 2.1 KB
/
configure.ps1
File metadata and controls
73 lines (60 loc) · 2.1 KB
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
71
72
73
param (
[Int32]$build = 0,
[String]$release = "Debug",
[String]$testingtools = ""
)
if ((${release} -ne "Release") -and (${release} -ne "Debug")) {
Write-Host "[x] Build mode must be Release or Debug"
Exit
}
# Create build directory if it doesn't exist
if (-not (Test-Path -Path "build")) {
New-Item -ItemType Directory -Path "build"
}
Set-Location "build"
# Testing tools
$tools_enabled = $false
if ($testingtools -eq "tools") {
Write-Host "[i] Tools enabled for compilation"
$tools_enabled = $true
}
if ($build -eq 0 -or $build -eq 32) {
# 32 bit build
Write-Host "[!] Creating 32 bit build"
if (-not (Test-Path -Path "build32")) {
New-Item -ItemType Directory -Path "build32"
}
Set-Location "build32"
Write-Host "Build type: $release"
Write-Host "Test tools: $tools_enabled"
# Run CMake to configure the project
if ($tools_enabled) {
cmake -DTEST_PROGRAMS=ON -DCMAKE_GENERATOR_PLATFORM=Win32 -DCMAKE_BUILD_TYPE=$release -G "Visual Studio 17 2022" -A Win32 ../..
} else {
cmake -DCMAKE_GENERATOR_PLATFORM=Win32 -DCMAKE_BUILD_TYPE=$release -G "Visual Studio 17 2022" -A Win32 ../..
}
cmake --build . --config ${release}
Set-Location ..
}
if ($build -eq 0 -or $build -eq 64) {
Write-Host "[!] Creating 64 bit build"
if (-not (Test-Path -Path "build64")) {
New-Item -ItemType Directory -Path "build64"
}
Set-Location "build64"
Write-Host "Build type: $release"
Write-Host "Test tools: $tools_enabled"
if ($tools_enabled) {
cmake -DTEST_PROGRAMS=ON -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_BUILD_TYPE=$release -G "Visual Studio 17 2022" -A x64 ../..
} else {
cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_BUILD_TYPE=$release -G "Visual Studio 17 2022" -A x64 ../..
}
cmake --build . --config ${release}
Set-Location ..
}
Set-Location ..
Write-Host "---"
Write-Host "[!] Output files in build/bin"
if ($testingtools -eq "") {
Write-Host "[i] Additonal testing tools can be compiled adding 'tools' at the end of the command (all arguments need to be present)"
}