25 lines
578 B
PHP
Raw Normal View History

2025-03-20 04:36:46 +01:00
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
2025-06-09 09:24:31 +08:00
use SPC\util\executor\UnixCMakeExecutor;
use SPC\util\SPCTarget;
2025-03-20 04:36:46 +01:00
trait mimalloc
{
protected function build(): void
{
$cmake = UnixCMakeExecutor::create($this)
->addConfigureArgs(
'-DMI_BUILD_SHARED=OFF',
'-DMI_INSTALL_TOPLEVEL=ON'
);
if (SPCTarget::isTarget(SPCTarget::MUSL) || SPCTarget::isTarget(SPCTarget::MUSL_STATIC)) {
$cmake->addConfigureArgs('-DMI_LIBC_MUSL=ON');
2025-03-20 04:36:46 +01:00
}
$cmake->build();
2025-03-20 04:36:46 +01:00
}
}