mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 13:24:51 +08:00
work around it for -target without version...
This commit is contained in:
parent
b3f1103143
commit
8c8800f156
@ -4,6 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\toolchain\ToolchainManager;
|
||||
use SPC\toolchain\ZigToolchain;
|
||||
use SPC\util\executor\UnixCMakeExecutor;
|
||||
use SPC\util\SPCTarget;
|
||||
|
||||
@ -11,6 +13,13 @@ trait libjxl
|
||||
{
|
||||
protected function build(): void
|
||||
{
|
||||
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
|
||||
if (str_contains(getenv('SPC_TARGET'), '.2.')) {
|
||||
throw new \RuntimeException('Zig toolchain does not support libjxl with target version.');
|
||||
}
|
||||
putenv('CC=gcc');
|
||||
putenv('CXX=g++');
|
||||
}
|
||||
UnixCMakeExecutor::create($this)
|
||||
->addConfigureArgs(
|
||||
'-DJPEGXL_ENABLE_TOOLS=OFF',
|
||||
@ -26,5 +35,9 @@ trait libjxl
|
||||
'-DBUILD_TESTING=OFF'
|
||||
)
|
||||
->build();
|
||||
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
|
||||
putenv('CC=zig-cc');
|
||||
putenv('CXX=zig-c++');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user