err, we need to install zig of course

This commit is contained in:
DubbleClick
2025-07-01 16:25:08 +07:00
parent 408b3b4060
commit f6c6011061
3 changed files with 8 additions and 4 deletions

View File

@@ -6,6 +6,8 @@ namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\toolchain\ToolchainManager;
use SPC\toolchain\ZigToolchain;
use SPC\util\executor\UnixCMakeExecutor;
trait libaom
@@ -16,8 +18,8 @@ trait libaom
*/
protected function build(): void
{
if (getenv('SPC_LIBC') === 'musl' && str_contains(getenv('CC'), 'zig')) {
f_putenv('COMPILER_EXTRA=-D_POSIX_SOURCE');
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
f_putenv('COMPILER_EXTRA=-D_GNU_SOURCE');
}
UnixCMakeExecutor::create($this)
->setBuildDir("{$this->source_dir}/builddir")