Skip to content

Commit 3a17cec

Browse files
committed
deploy extensions with -release flag too
1 parent 94644d3 commit 3a17cec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/SPC/builder/Extension.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,12 +455,17 @@ public function buildUnixShared(): void
455455

456456
// process *.so file
457457
$soFile = BUILD_MODULES_PATH . '/' . $this->getName() . '.so';
458+
$soDest = $soFile;
459+
preg_match('/-release\s+(\S*)/', getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS'), $matches);
460+
if (!empty($matches[1])) {
461+
$soDest = str_replace('.so', '-' . $matches[1] . '.so', $soFile);
462+
}
458463
if (!file_exists($soFile)) {
459464
throw new ValidationException("extension {$this->getName()} build failed: {$soFile} not found", validation_module: "Extension {$this->getName()} build");
460465
}
461466
/** @var UnixBuilderBase $builder */
462467
$builder = $this->builder;
463-
$builder->deployBinary($soFile, $soFile, false);
468+
$builder->deployBinary($soFile, $soDest, false);
464469
}
465470

466471
/**

0 commit comments

Comments
 (0)