Skip to content

Commit

Permalink
fix: Add Windows pkg-config wrapper script and batch file
Browse files Browse the repository at this point in the history
  • Loading branch information
silviot committed Dec 8, 2024
1 parent 4cef1b9 commit 2d65610
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ jobs:
$installPrefix = "$env:VCPKG_ROOT\installed\$env:VCPKG_TRIPLET"
# Set up pkg-config environment
$env:PKG_CONFIG = "$installPrefix\tools\pkgconf\pkg-config.ps1"
$env:PKG_CONFIG = "$installPrefix\tools\pkgconf\pkg-config.bat" # Changed to .bat
$env:PKG_CONFIG_PATH = "$installPrefix\lib\pkgconfig"
$env:PKG_CONFIG_LIBDIR = "$installPrefix\lib\pkgconfig"
$env:PKG_CONFIG_ALLOW_CROSS = "1"
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/install_vcpkg.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,21 @@ vcpkg install libadwaita:$env:VCPKG_TRIPLET
# Create pkg-config wrapper script to handle Windows paths
$wrapperContent = @"
#!/usr/bin/env pwsh
`$env:PKG_CONFIG_PATH = `$env:PKG_CONFIG_PATH -replace ";",":"
`$env:PKG_CONFIG_LIBDIR = `$env:PKG_CONFIG_LIBDIR -replace ";",":"
& "$pkgConfigPath" `$args
`$env:PKG_CONFIG_PATH = `$env:PKG_CONFIG_PATH -replace ';',':'
`$env:PKG_CONFIG_LIBDIR = `$env:PKG_CONFIG_LIBDIR -replace ';',':'
& '$pkgConfigPath' @args
"@

$batchContent = @"
@echo off
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ""%~dp0pkg-config.ps1"" %*
"@

$wrapperPath = "$env:VCPKG_ROOT\installed\$env:VCPKG_TRIPLET\tools\pkgconf\pkg-config.ps1"
$batchPath = "$env:VCPKG_ROOT\installed\$env:VCPKG_TRIPLET\tools\pkgconf\pkg-config.bat"

$wrapperContent | Out-File -FilePath $wrapperPath -Encoding UTF8
$batchContent | Out-File -FilePath $batchPath -Encoding ASCII

Write-Host "Created pkg-config wrapper at: $wrapperPath"
Write-Host "Created pkg-config batch wrapper at: $batchPath"

0 comments on commit 2d65610

Please sign in to comment.