From 8cb93bc1fe8e9e0eb283540fdf481c49b0918523 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Wed, 26 Mar 2025 12:39:15 +0800 Subject: [PATCH] Add more exception and log --- src/SPC/builder/Extension.php | 3 +++ src/SPC/command/BuildPHPCommand.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/SPC/builder/Extension.php b/src/SPC/builder/Extension.php index 7091aaf1..b1943c40 100644 --- a/src/SPC/builder/Extension.php +++ b/src/SPC/builder/Extension.php @@ -303,6 +303,9 @@ class Extension public function setBuildStatic(): void { + if (!in_array('static', Config::getExtTarget($this->name))) { + throw new WrongUsageException("Extension [{$this->name}] does not support static build !"); + } $this->build_static = true; } diff --git a/src/SPC/command/BuildPHPCommand.php b/src/SPC/command/BuildPHPCommand.php index f55bebbf..ca258f5d 100644 --- a/src/SPC/command/BuildPHPCommand.php +++ b/src/SPC/command/BuildPHPCommand.php @@ -238,8 +238,8 @@ class BuildPHPCommand extends BuildCommand } if (!empty($shared_extensions)) { foreach ($shared_extensions as $ext) { - $path = FileSystem::convertPath("{$build_root_path}/ext/{$ext}.so"); - logger()->info("Dynamic extension path{$fixed}: {$path}"); + $path = FileSystem::convertPath("{$build_root_path}/lib/{$ext}.so"); + logger()->info("Shared extension [{$ext}] path{$fixed}: {$path}"); } }