Skip to content

Commit 69e1acd

Browse files
committed
really stupid patch
1 parent e162a0e commit 69e1acd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/SPC/builder/unix/library/libaom.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,20 @@ trait libaom
1616
*/
1717
protected function build(): void
1818
{
19-
putenv('libaom_CFLAGS=-D__PIE__');
19+
$cc = getenv('CC');
20+
$cxx = getenv('CXX');
21+
if (str_contains($cc, 'zig') && getenv('SPC_LIBC') === 'musl') {
22+
putenv('CC=' . $cc . ' -D_POSIX_SOURCE');
23+
putenv('CXX=' . $cxx . ' -D_POSIX_SOURCE');
24+
}
2025
UnixCMakeExecutor::create($this)
2126
->setBuildDir("{$this->source_dir}/builddir")
2227
->addConfigureArgs('-DAOM_TARGET_CPU=generic')
2328
->build();
29+
if (str_contains($cc, 'zig') && getenv('SPC_LIBC') === 'musl') {
30+
putenv('CC=' . $cc);
31+
putenv('CXX=' . $cxx);
32+
}
2433
$this->patchPkgconfPrefix(['aom.pc']);
2534
}
2635
}

0 commit comments

Comments
 (0)