Skip to content

Commit 0a24a6a

Browse files
committed
move check when to build to extension.php instead of builder
1 parent 52f40b7 commit 0a24a6a

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/SPC/builder/BuilderBase.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -262,17 +262,6 @@ public function buildSharedExts(): void
262262
if (!$ext->isBuildShared()) {
263263
continue;
264264
}
265-
if (Config::getExt($ext->getName(), 'type') === 'builtin' || Config::getExt($ext->getName(), 'build-with-php') === true) {
266-
if (file_exists(BUILD_MODULES_PATH . '/' . $ext->getName() . '.so')) {
267-
logger()->info('Shared extension [' . $ext->getName() . '] was already built by php-src/configure (' . $ext->getName() . '.so)');
268-
continue;
269-
}
270-
if (Config::getExt($ext->getName(), 'build-with-php') === true) {
271-
logger()->warning('Shared extension [' . $ext->getName() . '] did not build with php-src/configure (' . $ext->getName() . '.so)');
272-
logger()->warning('Try deleting your build and source folders and running `spc build`` again.');
273-
continue;
274-
}
275-
}
276265
$ext->buildShared();
277266
}
278267
} catch (RuntimeException $e) {

src/SPC/builder/Extension.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,17 @@ public function validate(): void
328328
*/
329329
public function buildShared(): void
330330
{
331+
if (Config::getExt($this->getName(), 'type') === 'builtin' || Config::getExt($this->getName(), 'build-with-php') === true) {
332+
if (file_exists(BUILD_MODULES_PATH . '/' . $this->getName() . '.so')) {
333+
logger()->info('Shared extension [' . $this->getName() . '] was already built by php-src/configure (' . $this->getName() . '.so)');
334+
return;
335+
}
336+
if (Config::getExt($this->getName(), 'build-with-php') === true) {
337+
logger()->warning('Shared extension [' . $this->getName() . '] did not build with php-src/configure (' . $this->getName() . '.so)');
338+
logger()->warning('Try deleting your build and source folders and running `spc build`` again.');
339+
return;
340+
}
341+
}
331342
logger()->info('Building extension [' . $this->getName() . '] as shared extension (' . $this->getName() . '.so)');
332343
foreach ($this->dependencies as $dependency) {
333344
if (!$dependency instanceof Extension) {

0 commit comments

Comments
 (0)