Skip to content

Commit

Permalink
Merge pull request #1278 from dgreatwood/winPkgConfInVCPAfterFstSetup
Browse files Browse the repository at this point in the history
Fix: Set PKG_CONFIG_PATH when vcpkg NOT newly installed
  • Loading branch information
dgreatwood authored Jan 7, 2025
2 parents 0be5c9c + 32676df commit 2702a55
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.28.20250104
0.4.29.20250106
26 changes: 13 additions & 13 deletions winscripts/helpers/commonsetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,17 @@ if (($env:VCPKG_DIR) -And (Test-Path -Path "$env:VCPKG_DIR")) {
$env:VCPKG_INSTALLATION_ROOT=$env:VCPKG_DIR # As per github Windows images
$env:VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT
$env:Path="$env:Path;$env:VCPKG_DIR"

$my_vcpkg_pc_dir = "$env:VCPKG_DIR\installed\x64-windows\lib\pkgconfig"
if ($env:PKG_CONFIG_PATH) {
if (! (($Env:PKG_CONFIG_PATH -split ";").TrimEnd('\').TrimEnd('/') `
-contains $my_vcpkg_pc_dir)) {
$env:PKG_CONFIG_PATH = "$env:PKG_CONFIG_PATH;$my_vcpkg_pc_dir"
}
}
else {
$env:PKG_CONFIG_PATH="$my_vcpkg_pc_dir"
}
}

cd $savedpwd
Expand Down Expand Up @@ -667,19 +678,8 @@ if ((! (Get-Command pkg-config -errorAction SilentlyContinue)) -or `
Sort-Object -Descending -Property LastWriteTime | `
Select -Index 0 | Select -ExpandProperty "FullName"
}
if (($my_vcpkg_pkgconfig_dir) -And `
(Test-Path -Path $my_vcpkg_pkgconfig_dir)) {
$my_vcpkg_pkgconfig_dir = `
"$env:VCPKG_DIR\installed\x64-windows\lib\pkgconfig"
if ($env:PKG_CONFIG_PATH) {
$env:PKG_CONFIG_PATH = `
"$env:PKG_CONFIG_PATH;$my_vcpkg_pkgconfig_dir"
}
else {
$env:PKG_CONFIG_PATH="$my_vcpkg_pkgconfig_dir"
}
}
else {
if ((! $my_vcpkg_pkgconfig_dir) -Or `
(! (Test-Path -Path $my_vcpkg_pkgconfig_dir))) {
throw "ERROR: pkgconf not installed as expected"
}
}
Expand Down

0 comments on commit 2702a55

Please sign in to comment.