Use isStatic instead of isStaticTarget

This commit is contained in:
crazywhalecc
2025-06-29 22:49:48 +08:00
parent 956688d9f4
commit e1e48922de
8 changed files with 9 additions and 9 deletions

View File

@@ -39,7 +39,7 @@ trait imagemagick
);
// special: linux-static target needs `-static`
$ldflags = SPCTarget::isStaticTarget() ? ('-static -ldl') : '-ldl';
$ldflags = SPCTarget::isStatic() ? ('-static -ldl') : '-ldl';
// special: macOS needs -iconv
$libs = SPCTarget::getTargetOS() === 'Darwin' ? '-liconv' : '';

View File

@@ -14,7 +14,7 @@ trait pkgconfig
UnixAutoconfExecutor::create($this)
->appendEnv([
'CFLAGS' => PHP_OS_FAMILY !== 'Linux' ? '-Wimplicit-function-declaration -Wno-int-conversion' : '',
'LDFLAGS' => SPCTarget::isStaticTarget() ? '--static' : '',
'LDFLAGS' => SPCTarget::isStatic() ? '--static' : '',
])
->configure(
'--with-internal-glib',

View File

@@ -51,7 +51,7 @@ trait postgresql
$error_exec_cnt += $output[0] === 0 ? 0 : 1;
if (!empty($output[1][0])) {
$ldflags = $output[1][0];
$envs .= SPCTarget::isStaticTarget() ? " LDFLAGS=\"{$ldflags} -static\" " : " LDFLAGS=\"{$ldflags}\" ";
$envs .= SPCTarget::isStatic() ? " LDFLAGS=\"{$ldflags} -static\" " : " LDFLAGS=\"{$ldflags}\" ";
}
$output = shell()->execWithResult("pkg-config --libs-only-l --static {$packages}");
$error_exec_cnt += $output[0] === 0 ? 0 : 1;