refactor macos builder

This commit is contained in:
crazywhalecc
2023-04-03 20:47:24 +08:00
parent 3709bcc5e4
commit 09e5c16570
23 changed files with 278 additions and 329 deletions

View File

@@ -202,6 +202,16 @@ abstract class BuilderBase
return $this->libs_only;
}
/**
* 获取当前即将编译的 PHP 的版本 ID五位数那个
*/
public function getPHPVersionID(): int
{
$file = file_get_contents(SOURCE_PATH . '/php-src/main/php_version.h');
preg_match('/PHP_VERSION_ID (\d+)/', $file, $match);
return intval($match[1]);
}
/**
* 检查是否存在 lib 库对应的源码,如果不存在,则抛出异常
*