force minimum version 3.12 for cmake policies in freetype, only when cmake >= 4

This commit is contained in:
DubbleClick
2025-06-04 21:18:44 +07:00
parent dabf52511f
commit ef7ebdfd1f
4 changed files with 34 additions and 15 deletions

View File

@@ -87,17 +87,14 @@ class LinuxToolCheckList
#[AsCheckItem('if cmake version >= 3.18', limit_os: 'Linux')]
public function checkCMakeVersion(): ?CheckResult
{
$check_cmd = 'cmake --version';
$pattern = '/cmake version (.*)/m';
$out = shell()->execWithResult($check_cmd, false)[1][0];
if (preg_match($pattern, $out, $match)) {
$ver = $match[1];
if (version_compare($ver, '3.18.0') <= 0) {
return CheckResult::fail('cmake version is too low (' . $ver . '), please update it manually!');
}
return CheckResult::ok($match[1]);
$ver = get_cmake_version();
if ($ver === null) {
return CheckResult::fail('Failed to get cmake version');
}
return CheckResult::fail('Failed to get cmake version');
if (version_compare($ver, '3.18.0') < 0) {
return CheckResult::fail('cmake version is too low (' . $ver . '), please update it manually!');
}
return CheckResult::ok($ver);
}
/** @noinspection PhpUnused */