Files

19 lines
1.1 KiB
PowerShell

# Build the native _vde pybind11 subset with MSVC (no assembly binding).
# Usage:
# powershell -ExecutionPolicy Bypass -File python/build_native_msvc.ps1 -PythonRoot C:\Python314 -PybindDir build\pybind11-install\share\cmake\pybind11
param(
[string]$PythonRoot = "C:\Python314",
[string]$PybindDir = "",
[string]$BuildDir = "build/native",
[string]$SourceDir = "."
)
$ErrorActionPreference = "Stop"
$pythonExe = Join-Path $PythonRoot "python.exe"
if (-not (Test-Path $pythonExe)) { throw "python.exe not found under $PythonRoot" }
if (-not $PybindDir) { throw "-PybindDir is required (pybind11Config.cmake directory)" }
cmake -S $SourceDir -B $BuildDir -G "Visual Studio 17 2022" -A x64 -DVDE_BUILD_PYTHON=ON -DVDE_PYBIND11_DIR=$PybindDir -DPython_EXECUTABLE=$pythonExe -DPython_ROOT_DIR=$PythonRoot
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
cmake --build $BuildDir --config Release --target _vde -- /m:8
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Write-Host "native _vde built; copy python/Release/_vde.*.pyd into the vde package for local import."