move -Wno-date-time to ZigToolchain instead of env.ini

This commit is contained in:
DubbleClick 2025-07-24 15:51:08 +07:00
parent 6da3f78df6
commit 41bb3e7319
2 changed files with 15 additions and 9 deletions

View File

@ -63,8 +63,6 @@ PHP_SDK_PATH="${WORKING_DIR}\php-sdk-binary-tools"
UPX_EXEC="${PKG_ROOT_PATH}\bin\upx.exe" UPX_EXEC="${PKG_ROOT_PATH}\bin\upx.exe"
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches ; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime140,win32,zend_stream,cli_static SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime140,win32,zend_stream,cli_static
; Windows static linking system libs
SPC_EXTRA_LIBS=""
[linux] [linux]
; Linux can use different build toolchains. ; Linux can use different build toolchains.

View File

@ -38,13 +38,6 @@ class ZigToolchain implements ToolchainInterface
} }
} }
GlobalEnvManager::putenv('SPC_EXTRA_RUNTIME_OBJECTS=' . implode(' ', $found)); GlobalEnvManager::putenv('SPC_EXTRA_RUNTIME_OBJECTS=' . implode(' ', $found));
$extra_libs = getenv('SPC_EXTRA_LIBS') ?: '';
if (!str_contains($extra_libs, '-lunwind')) {
// Add unwind library if not already present
$extra_libs = trim($extra_libs . ' -lunwind');
GlobalEnvManager::putenv("SPC_EXTRA_LIBS={$extra_libs}");
}
} }
/** /**
@ -56,5 +49,20 @@ class ZigToolchain implements ToolchainInterface
throw new WrongUsageException('You are building with zig, but zig is not installed, please install zig first. (You can use `doctor` command to install it)'); throw new WrongUsageException('You are building with zig, but zig is not installed, please install zig first. (You can use `doctor` command to install it)');
} }
GlobalEnvManager::addPathIfNotExists(Zig::getEnvironment()['PATH']); GlobalEnvManager::addPathIfNotExists(Zig::getEnvironment()['PATH']);
$cflags = getenv('SPC_DEFAULT_C_FLAGS') ?: '';
$cxxflags = getenv('SPC_DEFAULT_CXX_FLAGS') ?: '';
$extraCflags = getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') ?: '';
$cflags = trim($cflags . ' -Wno-date-time');
$cxxflags = trim($cxxflags . ' -Wno-date-time');
$extraCflags = trim($extraCflags . ' -Wno-date-time');
GlobalEnvManager::putenv("SPC_EXTRA_CFLAGS={$cflags}");
GlobalEnvManager::putenv("SPC_EXTRA_CXXFLAGS={$cxxflags}");
GlobalEnvManager::putenv("SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS={$extraCflags}");
$extra_libs = getenv('SPC_EXTRA_LIBS') ?: '';
if (!str_contains($extra_libs, '-lunwind')) {
// Add unwind library if not already present
$extra_libs = trim($extra_libs . ' -lunwind');
GlobalEnvManager::putenv("SPC_EXTRA_LIBS={$extra_libs}");
}
} }
} }