mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-05 07:45:39 +08:00
Fix opentelemetry strict flag
This commit is contained in:
@@ -7,15 +7,21 @@ namespace Package\Extension;
|
||||
use Package\Target\php;
|
||||
use StaticPHP\Attribute\Package\BeforeStage;
|
||||
use StaticPHP\Attribute\Package\Extension;
|
||||
use StaticPHP\Toolchain\Interface\ToolchainInterface;
|
||||
use StaticPHP\Toolchain\ZigToolchain;
|
||||
use StaticPHP\Util\GlobalEnvManager;
|
||||
|
||||
#[Extension('opentelemetry')]
|
||||
class opentelemetry
|
||||
{
|
||||
#[BeforeStage('php', [php::class, 'makeForUnix'], 'ext-opentelemetry')]
|
||||
public function patchBeforeMake(): void
|
||||
public function patchBeforeMake(ToolchainInterface $toolchain): void
|
||||
{
|
||||
// add -Wno-strict-prototypes
|
||||
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS=' . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') . ' -Wno-strict-prototypes');
|
||||
$extra_cflags = getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') ?: '';
|
||||
$extra_cflags .= ' -Wno-strict-prototypes';
|
||||
if ($toolchain instanceof ZigToolchain) {
|
||||
$extra_cflags .= ' -Wno-unknown-warning-option';
|
||||
}
|
||||
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS=' . trim($extra_cflags));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user