File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 66
77use SPC \exception \FileSystemException ;
88use SPC \exception \RuntimeException ;
9+ use SPC \toolchain \ToolchainManager ;
10+ use SPC \toolchain \ZigToolchain ;
911use SPC \util \executor \UnixCMakeExecutor ;
1012
1113trait libaom
@@ -16,8 +18,8 @@ trait libaom
1618 */
1719 protected function build (): void
1820 {
19- if (getenv ( ' SPC_LIBC ' ) === ' musl ' && str_contains ( getenv ( ' CC ' ), ' zig ' ) ) {
20- f_putenv ('COMPILER_EXTRA=-D_POSIX_SOURCE ' );
21+ if (ToolchainManager:: getToolchainClass ( ) === ZigToolchain::class ) {
22+ f_putenv ('COMPILER_EXTRA=-D_GNU_SOURCE ' );
2123 }
2224 UnixCMakeExecutor::create ($ this )
2325 ->setBuildDir ("{$ this ->source_dir }/builddir " )
Original file line number Diff line number Diff line change 55namespace SPC \command ;
66
77use SPC \exception \ValidationException ;
8+ use SPC \toolchain \ToolchainManager ;
9+ use SPC \toolchain \ZigToolchain ;
810use SPC \util \ConfigValidator ;
911use Symfony \Component \Console \Attribute \AsCommand ;
1012use Symfony \Component \Process \Process ;
@@ -76,7 +78,7 @@ public function handle(): int
7678 }
7779 }
7880 // install zig if requested
79- if (str_contains ( getenv ( ' CC ' ), ' zig ' ) ) {
81+ if (ToolchainManager:: getToolchainClass () === ZigToolchain::class ) {
8082 $ retcode = $ this ->runCommand ('install-pkg ' , 'zig ' );
8183 if ($ retcode !== 0 ) {
8284 $ this ->output ->writeln ('<error>craft zig failed</error> ' );
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public function fixMuslCrossMake(): bool
4747 'BSD ' => 'freebsd ' ,
4848 default => 'linux ' ,
4949 };
50- PackageManager::installPackage ("musl-toolchain - {$ arch }- {$ os }" );
50+ PackageManager::installPackage ("zig - {$ arch }- {$ os }" );
5151 return Zig::isInstalled ();
5252 }
5353}
You can’t perform that action at this time.
0 commit comments