diff --git a/src/SPC/builder/BuilderBase.php b/src/SPC/builder/BuilderBase.php index 433d0b97..7fc78e44 100644 --- a/src/SPC/builder/BuilderBase.php +++ b/src/SPC/builder/BuilderBase.php @@ -262,17 +262,6 @@ abstract class BuilderBase if (!$ext->isBuildShared()) { continue; } - if (Config::getExt($ext->getName(), 'type') === 'builtin' || Config::getExt($ext->getName(), 'build-with-php') === true) { - if (file_exists(BUILD_MODULES_PATH . '/' . $ext->getName() . '.so')) { - logger()->info('Shared extension [' . $ext->getName() . '] was already built by php-src/configure (' . $ext->getName() . '.so)'); - continue; - } - if (Config::getExt($ext->getName(), 'build-with-php') === true) { - logger()->warning('Shared extension [' . $ext->getName() . '] did not build with php-src/configure (' . $ext->getName() . '.so)'); - logger()->warning('Try deleting your build and source folders and running `spc build`` again.'); - continue; - } - } $ext->buildShared(); } } catch (RuntimeException $e) { diff --git a/src/SPC/builder/Extension.php b/src/SPC/builder/Extension.php index 74be112c..5b35aade 100644 --- a/src/SPC/builder/Extension.php +++ b/src/SPC/builder/Extension.php @@ -328,6 +328,17 @@ class Extension */ public function buildShared(): void { + if (Config::getExt($this->getName(), 'type') === 'builtin' || Config::getExt($this->getName(), 'build-with-php') === true) { + if (file_exists(BUILD_MODULES_PATH . '/' . $this->getName() . '.so')) { + logger()->info('Shared extension [' . $this->getName() . '] was already built by php-src/configure (' . $this->getName() . '.so)'); + return; + } + if (Config::getExt($this->getName(), 'build-with-php') === true) { + logger()->warning('Shared extension [' . $this->getName() . '] did not build with php-src/configure (' . $this->getName() . '.so)'); + logger()->warning('Try deleting your build and source folders and running `spc build`` again.'); + return; + } + } logger()->info('Building extension [' . $this->getName() . '] as shared extension (' . $this->getName() . '.so)'); foreach ($this->dependencies as $dependency) { if (!$dependency instanceof Extension) {