build/windows: Add support to Cmake builds on self_build function

This can be useful in the future if we need to build some dependency that
does not use Meson (hope we will not need that but anyway)

(cherry picked from commit 8ea6e4031e)
This commit is contained in:
Bruno Lopes 2025-09-06 18:03:44 -03:00 committed by Jehan
parent 4d73d78c25
commit 38eec6a0a6
2 changed files with 12 additions and 4 deletions

View file

@ -88,8 +88,16 @@ function self_build ([string]$repo, [array]$branch, [array]$patches, [array]$opt
## Configure and/or build
if (-not (Test-Path _build-$env:MSYSTEM_PREFIX\build.ninja -Type Leaf))
{
meson setup _build-$env:MSYSTEM_PREFIX -Dprefix="$GIMP_PREFIX" $PKGCONF_RELOCATABLE_OPTION `
$(if ($branch -like '-*') { "$branch" } elseif ($patches -like '-*') { "$patches" } else { "$options" });
if (Test-Path meson.build -Type Leaf)
{
meson setup _build-$env:MSYSTEM_PREFIX -Dprefix="$GIMP_PREFIX" $PKGCONF_RELOCATABLE_OPTION --buildtype=debugoptimized `
$(if ($branch -like '-*') { "$branch" } elseif ($patches -like '-*') { "$patches" } else { "$options" });
}
elseif (Test-Path CMakeLists.txt -Type Leaf)
{
cmake -G Ninja -B _build-$env:MSYSTEM_PREFIX -DCMAKE_INSTALL_PREFIX="$GIMP_PREFIX" -DCMAKE_BUILD_TYPE=RelWithDebInfo `
$(if ($branch -like '-*') { "$branch" } elseif ($patches -like '-*') { "$patches" } else { "$options" });
}
if ("$LASTEXITCODE" -gt '0') { exit 1 }
}
Set-Location _build-$env:MSYSTEM_PREFIX

View file

@ -44,8 +44,8 @@ if (-not (Test-Path _build-$env:MSYSTEM_PREFIX\build.ninja -Type Leaf))
{
#FIXME: There is no GJS for Windows. See: https://gitlab.gnome.org/GNOME/gimp/-/issues/5891
meson setup _build-$env:MSYSTEM_PREFIX -Dprefix="$GIMP_PREFIX" $NON_RELOCATABLE_OPTION `
$INSTALLER_OPTION $STORE_OPTION $PKGCONF_RELOCATABLE_OPTION `
-Denable-default-bin=enabled -Dbuild-id='org.gimp.GIMP_official';
$INSTALLER_OPTION $STORE_OPTION $PKGCONF_RELOCATABLE_OPTION `
-Denable-default-bin=enabled -Dbuild-id='org.gimp.GIMP_official';
if ("$LASTEXITCODE" -gt '0') { exit 1 }
}
Set-Location _build-$env:MSYSTEM_PREFIX