[mixed] refactor with putenv, fix imagemagick and c++ build

This commit is contained in:
crazywhalecc
2023-10-23 00:37:28 +08:00
parent 5934e5e881
commit c84eb723ec
52 changed files with 205 additions and 168 deletions

View File

@@ -112,6 +112,16 @@ abstract class BuilderBase
return $this->libs[$name] ?? null;
}
/**
* Get all library objects.
*
* @return LibraryBase[]
*/
public function getLibs(): array
{
return $this->libs;
}
/**
* Add extension to build.
*/
@@ -139,12 +149,12 @@ abstract class BuilderBase
}
/**
* Check if there is a cpp extension.
* Check if there is a cpp extensions or libraries.
*
* @throws FileSystemException
* @throws WrongUsageException
*/
public function hasCppExtension(): bool
public function hasCpp(): bool
{
// judge cpp-extension
$exts = array_keys($this->getExts());
@@ -153,6 +163,12 @@ abstract class BuilderBase
return true;
}
}
$libs = array_keys($this->getLibs());
foreach ($libs as $lib) {
if (Config::getLib($lib, 'cpp-library', false) === true) {
return true;
}
}
return false;
}