-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
35 lines (30 loc) · 1.15 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
$ErrorActionPreference = "Stop"
$root_dir = Get-Location
New-Item -ItemType Directory -Path "$root_dir/bin" -Force
# Install python dependencies
pip install -r requirements.txt
# Build backend C++ project
Set-Location "$root_dir/backend"
if (Test-Path "build") {
Remove-Item "build" -Recurse -Force
}
New-Item -ItemType Directory -Path "build" | Out-Null
Set-Location "build"
cmake -G "MinGW Makefiles" ..
mingw32-make -j 16
Copy-Item -Path ".\backend.exe" -Destination "$root_dir/bin" -Force
# Build rust project: renderer
Set-Location $root_dir
Set-Location "$root_dir/renderer"
cargo build --release
Copy-Item -Path ".\target\release\renderer.exe" -Destination "$root_dir/bin" -Force
# Build rust project: renderer_sparse
Set-Location $root_dir
Set-Location "$root_dir/renderer_sparse"
cargo build --release
Copy-Item -Path ".\target\release\renderer_sparse.exe" -Destination "$root_dir/bin" -Force
# Download map data and generate db file
Set-Location "$root_dir/map_data"
Invoke-WebRequest -Uri "https://overpass-api.de/api/map?bbox=120.21,30.10,122.32,31.93" -OutFile "map.osm"
Set-Location "$root_dir"
python preprocess_osm.py