mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Fix c++, check pkg-config exists before calling PkgConfigUtil
This commit is contained in:
parent
dea3c4afeb
commit
099425abc8
@ -86,8 +86,9 @@ class SPCConfigUtil
|
||||
if (SPCTarget::getTargetOS() === 'Darwin') {
|
||||
$libs .= " {$this->getFrameworksString($extensions)}";
|
||||
}
|
||||
$libs .= $this->builder->hasCpp() && $this->builder instanceof MacOSBuilder ? ' -lc++' : ' -lstdc++';
|
||||
|
||||
if ($this->builder->hasCpp()) {
|
||||
$libs .= $this->builder instanceof MacOSBuilder ? ' -lc++' : ' -lstdc++';
|
||||
}
|
||||
if ($this->libs_only_deps) {
|
||||
return [
|
||||
'cflags' => trim(getenv('CFLAGS') . ' ' . $cflags),
|
||||
@ -130,7 +131,13 @@ class SPCConfigUtil
|
||||
|
||||
// parse pkg-configs
|
||||
foreach ($libraries as $library) {
|
||||
$pc_cflags = implode(' ', Config::getLib($library, 'pkg-configs', []));
|
||||
$pc = Config::getLib($library, 'pkg-configs', []);
|
||||
foreach ($pc as $file) {
|
||||
if (!file_exists(BUILD_LIB_PATH . "/pkgconfig/{$file}.pc")) {
|
||||
throw new WrongUsageException("pkg-config file '{$file}.pc' for lib [{$library}] does not exist in '" . BUILD_LIB_PATH . "/pkgconfig'. Please build it first.");
|
||||
}
|
||||
}
|
||||
$pc_cflags = implode(' ', $pc);
|
||||
if ($pc_cflags !== '') {
|
||||
$pc_cflags = PkgConfigUtil::getCflags($pc_cflags);
|
||||
$includes[] = $pc_cflags;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user