Add openssl version getter for Windows, test openssl

This commit is contained in:
crazywhalecc
2025-07-30 23:23:12 +08:00
parent 5f5d934d58
commit af10cacdff
7 changed files with 72 additions and 27 deletions

View File

@@ -8,6 +8,21 @@ use SPC\exception\RuntimeException;
class PkgConfigUtil
{
/**
* Returns the version of a module.
* This method uses `pkg-config --modversion` to get the version of the specified module.
* If the module is not found, it will throw a RuntimeException.
*
* @param string $pkg_config_str .pc file str, accepts multiple files
* @return string version string, e.g. "1.2.3"
* @throws RuntimeException
*/
public static function getModuleVersion(string $pkg_config_str): string
{
$result = self::execWithResult("pkg-config --modversion {$pkg_config_str}");
return trim($result);
}
/**
* Returns --cflags-only-other output.
* The reason we return the string is we cannot use array_unique() on cflags,