TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
960 B
25 lines
960 B
<?php
|
|
|
|
function requireMacosCondition(bool $condition, string $message): void
|
|
{
|
|
if (!$condition) {
|
|
throw new RuntimeException($message);
|
|
}
|
|
}
|
|
|
|
function main(): void
|
|
{
|
|
$zts = PHP_ZTS !== 0 && PHP_ZTS !== false;
|
|
requireMacosCondition(PHP_OS_FAMILY === 'Darwin', 'Expected PHP_OS_FAMILY=Darwin');
|
|
requireMacosCondition(DIRECTORY_SEPARATOR === '/', 'Expected the Unix directory separator');
|
|
requireMacosCondition(
|
|
macos_native_php_is_zts() === $zts,
|
|
'PHP_ZTS does not match the native ZTS macro',
|
|
);
|
|
requireMacosCondition(macos_native_is_arm64(), 'The native compiler target is not ARM64');
|
|
requireMacosCondition(macos_current_process_id() > 0, 'getpid() failed');
|
|
requireMacosCondition(macos_logical_processor_count() > 0, 'sysctl() returned no processors');
|
|
requireMacosCondition(macos_has_mach_host_port(), 'mach_host_self() failed');
|
|
|
|
echo 'macos-arm64-smoke-ok:', $zts ? 'zts' : 'nts';
|
|
}
|
|
|