Add frameworks for extension

This commit is contained in:
crazywhalecc
2025-06-12 01:16:57 +08:00
parent 2ea8a7e662
commit e0734fe848
4 changed files with 31 additions and 1 deletions

View File

@@ -53,6 +53,11 @@ class Extension
}
}
public function getFrameworks(): array
{
return Config::getExt($this->getName(), 'frameworks', []);
}
/**
* 获取开启该扩展的 PHP 编译添加的参数
*

View File

@@ -67,6 +67,10 @@ class MacOSBuilder extends UnixBuilderBase
array_push($frameworks, ...$lib->getFrameworks());
}
foreach ($this->exts as $ext) {
array_push($frameworks, ...$ext->getFrameworks());
}
if ($asString) {
return implode(' ', array_map(fn ($x) => "-framework {$x}", $frameworks));
}