-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.ps1
47 lines (30 loc) · 1.5 KB
/
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
# The Windows Build: Execute this from a prompt of type `Developer PowerShell for VS 2022`.
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$conan_profile = "$PSScriptRoot/conan/profiles/win64"
$build_types = @("Debug", "RelWithDebInfo")
$subprojects = @("morpe", "tests/morpe")
foreach ($build_type in $build_types)
{
$build_folder = "$PSScriptRoot/cmake-build-$($build_type.ToLower() )"
foreach ($subproject in $subprojects)
{
$proj_folder = "$PSScriptRoot/$subproject"
$proj_build_folder = "$build_folder/$subproject"
Write-Host "[BEGIN] $build_type $subproject conan install"
mkdir -Force "$proj_build_folder"
conan install "$proj_folder" --install-folder "$proj_build_folder" --build=outdated --update --profile $conan_profile -s build_type=$build_type
Write-Host "[END] $build_type $subproject conan install"
}
# Uncomment this to skip the actual build.
# continue;
# ------------------------------------------------------------
Write-Host "[BEGIN] $build_type configure"
# We use the Ninja because it is the default generator expected by CLion.
cmake -G Ninja -DCMAKE_BUILD_TYPE=$build_type -S "$PSScriptRoot" -B "$build_folder"
Write-Host "[END] $build_type configure"
# ------------------------------------------------------------
Write-Host "[BEGIN] $build_type build"
make --directory="$build_folder"
Write-Host "[END] $build_type build"
}