File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,22 @@ public function checkCliTools(): ?CheckResult
74
74
return CheckResult::ok ();
75
75
}
76
76
77
+ #[AsCheckItem('if cmake version >= 3.18 ' , limit_os: 'Linux ' )]
78
+ public function checkCMakeVersion (): ?CheckResult
79
+ {
80
+ $ check_cmd = 'cmake --version ' ;
81
+ $ pattern = '/cmake version (.*)/m ' ;
82
+ $ out = shell ()->execWithResult ($ check_cmd , false )[1 ][0 ];
83
+ if (preg_match ($ pattern , $ out , $ match )) {
84
+ $ ver = $ match [1 ];
85
+ if (version_compare ($ ver , '3.18.0 ' ) <= 0 ) {
86
+ return CheckResult::fail ('cmake version is too low ( ' . $ ver . '), please update it manually! ' );
87
+ }
88
+ return CheckResult::ok ($ match [1 ]);
89
+ }
90
+ return CheckResult::fail ('Failed to get cmake version ' );
91
+ }
92
+
77
93
/** @noinspection PhpUnused */
78
94
#[AsCheckItem('if necessary linux headers are installed ' , limit_os: 'Linux ' )]
79
95
public function checkSystemOSPackages (): ?CheckResult
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public function checkOS(): ?CheckResult
20
20
return CheckResult::fail ('Current OS is not supported: ' . PHP_OS_FAMILY );
21
21
}
22
22
$ distro = PHP_OS_FAMILY === 'Linux ' ? (' ' . SystemUtil::getOSRelease ()['dist ' ]) : '' ;
23
- $ known_distro = PHP_OS_FAMILY === 'Linux ' && in_array (SystemUtil::getOSRelease ()['dist ' ], SystemUtil::getSupportedDistros ());
23
+ $ known_distro = PHP_OS_FAMILY !== 'Linux ' || in_array (SystemUtil::getOSRelease ()['dist ' ], SystemUtil::getSupportedDistros ());
24
24
return CheckResult::ok (PHP_OS_FAMILY . ' ' . php_uname ('m ' ) . $ distro . ', supported ' . ($ known_distro ? '' : ' (but not tested on this distro) ' ));
25
25
}
26
26
}
You can’t perform that action at this time.
0 commit comments