-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-cpp.ps1
More file actions
52 lines (40 loc) · 1.45 KB
/
Copy pathbuild-cpp.ps1
File metadata and controls
52 lines (40 loc) · 1.45 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
# Build script for Glinx C++ core on Windows
$ErrorActionPreference = "Stop"
Write-Host "=== Building Glinx C++ Core ===" -ForegroundColor Cyan
# Create build directory
$BUILD_DIR = "glinx-core\build"
if (-not (Test-Path $BUILD_DIR)) {
New-Item -ItemType Directory -Path $BUILD_DIR | Out-Null
}
Push-Location $BUILD_DIR
try {
# Configure with CMake
Write-Host "`nConfiguring with CMake..." -ForegroundColor Yellow
cmake .. -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 17 2022"
if ($LASTEXITCODE -ne 0) {
throw "CMake configuration failed"
}
# Build
Write-Host "`nBuilding..." -ForegroundColor Yellow
cmake --build . --config Release
if ($LASTEXITCODE -ne 0) {
throw "Build failed"
}
Write-Host "`n✓ Build successful!" -ForegroundColor Green
Write-Host "`nArtifacts:" -ForegroundColor Cyan
Write-Host " - Static library: $BUILD_DIR\Release\glinx_core.lib"
Write-Host " - Python module: $BUILD_DIR\Release\_glinx_core.pyd"
# Run tests if requested
if ($args -contains "--test") {
Write-Host "`nRunning tests..." -ForegroundColor Yellow
ctest -C Release --output-on-failure
}
# Run benchmarks if requested
if ($args -contains "--bench") {
Write-Host "`nRunning benchmarks..." -ForegroundColor Yellow
.\Release\latency_bench.exe
.\Release\throughput_bench.exe 1000 5
}
} finally {
Pop-Location
}