mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
don't build avx2 if we don't have it
This commit is contained in:
parent
7204d277b4
commit
14b822a185
@ -29,13 +29,17 @@ trait libjxl
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
|
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
|
||||||
$cmake->addConfigureArgs(
|
$cflags = getenv('SPC_DEFAULT_C_FLAGS') ?: getenv('CFLAGS') ?: '';
|
||||||
'-DCXX_MAVX512F_SUPPORTED:BOOL=FALSE',
|
$has_avx512 = str_contains($cflags, '-mavx512') || str_contains($cflags, '-march=x86-64-v4');
|
||||||
'-DCXX_MAVX512DQ_SUPPORTED:BOOL=FALSE',
|
if (!$has_avx512) {
|
||||||
'-DCXX_MAVX512CD_SUPPORTED:BOOL=FALSE',
|
$cmake->addConfigureArgs(
|
||||||
'-DCXX_MAVX512BW_SUPPORTED:BOOL=FALSE',
|
'-DCXX_MAVX512F_SUPPORTED:BOOL=FALSE',
|
||||||
'-DCXX_MAVX512VL_SUPPORTED:BOOL=FALSE'
|
'-DCXX_MAVX512DQ_SUPPORTED:BOOL=FALSE',
|
||||||
);
|
'-DCXX_MAVX512CD_SUPPORTED:BOOL=FALSE',
|
||||||
|
'-DCXX_MAVX512BW_SUPPORTED:BOOL=FALSE',
|
||||||
|
'-DCXX_MAVX512VL_SUPPORTED:BOOL=FALSE'
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmake->build();
|
$cmake->build();
|
||||||
|
|||||||
@ -10,8 +10,13 @@ trait libwebp
|
|||||||
{
|
{
|
||||||
protected function build(): void
|
protected function build(): void
|
||||||
{
|
{
|
||||||
|
$cflags = getenv('SPC_DEFAULT_C_FLAGS') ?: getenv('CFLAGS') ?: '';
|
||||||
|
$has_avx2 = str_contains($cflags, '-mavx2') || str_contains($cflags, '-march=x86-64-v2') || str_contains($cflags, '-march=x86-64-v3');
|
||||||
UnixCMakeExecutor::create($this)
|
UnixCMakeExecutor::create($this)
|
||||||
->addConfigureArgs('-DWEBP_BUILD_EXTRAS=ON')
|
->addConfigureArgs(
|
||||||
|
'-DWEBP_BUILD_EXTRAS=ON',
|
||||||
|
'-DWEBP_ENABLE_SIMD=' . ($has_avx2 ? 'ON' : 'OFF'),
|
||||||
|
)
|
||||||
->build();
|
->build();
|
||||||
// patch pkgconfig
|
// patch pkgconfig
|
||||||
$this->patchPkgconfPrefix(patch_option: PKGCONF_PATCH_PREFIX | PKGCONF_PATCH_LIBDIR);
|
$this->patchPkgconfPrefix(patch_option: PKGCONF_PATCH_PREFIX | PKGCONF_PATCH_LIBDIR);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user