add swoole-hook-odbc to work the same way as the other hooks

This commit is contained in:
DubbleClick
2025-08-26 00:24:40 +07:00
parent 2694dd9e21
commit b1da64d46b
6 changed files with 62 additions and 17 deletions

View File

@@ -8,6 +8,7 @@ use SPC\builder\Extension;
use SPC\builder\macos\MacOSBuilder;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
use SPC\util\SPCConfigUtil;
#[CustomExt('swoole')]
class swoole extends Extension
@@ -76,7 +77,8 @@ class swoole extends Extension
$arg .= $this->builder->getExt('swoole-hook-sqlite') ? ' --enable-swoole-sqlite' : ' --disable-swoole-sqlite';
// enable this feature , need stop pdo_*
$arg .= $this->builder->getLib('unixodbc') && !$this->builder->getExt('pdo')?->isBuildStatic() ? ' --with-swoole-odbc=unixODBC,' . BUILD_ROOT_PATH : '';
$config = (new SPCConfigUtil($this->builder, ['libs_only_deps' => true]))->config([], ['unixodbc']);
$arg .= $this->builder->getExt('swoole-hook-odbc') ? ' --with-swoole-odbc=unixODBC,' . BUILD_ROOT_PATH . ' SWOOLE_ODBC_LIBS="' . $config['libs'] . '"' : '';
return $arg;
}
}