24 lines
508 B
PHP
Raw Normal View History

2025-03-20 04:36:46 +01:00
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\builder\unix\executor\UnixCMakeExecutor;
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'
);
2025-03-20 04:36:46 +01:00
if (getenv('SPC_LIBC') === 'musl') {
$cmake->addConfigureArgs('-DMI_LIBC_MUSL=ON');
2025-03-20 04:36:46 +01:00
}
$cmake->build();
2025-03-20 04:36:46 +01:00
}
}