7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 23:13:43 +00:00

Windows: Add post-build script for installation and file copying

This commit is contained in:
Ethan Chien 2025-02-02 07:55:11 +08:00
parent 8874f137fa
commit d96479dd34

31
tools/post_build.ps1 Normal file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env pwsh
# This script is used to perform post-build actions for development.
# It installs the build, copies necessary .pdb and .dll files to the output directory,
# and copies Python tools from the vcpkg installation.
$PROJECT_ROOT = git rev-parse --show-toplevel
$BUILD_ROOT = "$PROJECT_ROOT/build"
$BIN_DIR = "$BUILD_ROOT/out/bin/"
$VCPKG_INSTALL_ROOT = "$BUILD_ROOT/vcpkg_installed"
cmake --install $BUILD_ROOT
Get-ChildItem -Path $PROJECT_ROOT -Recurse -Filter *.pdb | Where-Object { $_.FullName -notmatch 'build/out/bin' } | ForEach-Object {
$destination = Join-Path -Path $BIN_DIR -ChildPath $_.Name
if ($_.FullName -ne $destination) {
Copy-Item -Path $_.FullName -Destination $BIN_DIR -Force
}
}
Get-ChildItem -Path $VCPKG_INSTALL_ROOT -Recurse -Filter *.dll | ForEach-Object {
$destination = Join-Path -Path $BIN_DIR -ChildPath $_.Name
if ($_.FullName -ne $destination) {
Copy-Item -Path $_.FullName -Destination $BIN_DIR -Force
}
}
Copy-Item -Path "$VCPKG_INSTALL_ROOT/x64-windows/tools/python3/*" -Destination $BIN_DIR -Recurse -Force