Add gnu based static binary support

This commit is contained in:
crazywhalecc
2025-01-28 19:37:50 +08:00
committed by Marc Henderkes
parent 878e17ddb4
commit 09c0e43501
6 changed files with 30 additions and 4 deletions

View File

@@ -37,7 +37,7 @@ class LinuxBuilder extends UnixBuilderBase
GlobalEnvManager::init($this);
// set library path, some libraries need it. (We cannot use `putenv` here, because cmake will be confused)
if (!filter_var(getenv('SPC_NO_MUSL_PATH'), FILTER_VALIDATE_BOOLEAN)) {
if (!filter_var(getenv('SPC_NO_MUSL_PATH'), FILTER_VALIDATE_BOOLEAN) && $this->libc !== LIBC_GLIBC) {
$this->setOptionIfNotExist('library_path', "LIBRARY_PATH=\"/usr/local/musl/{$arch}-linux-musl/lib\"");
$this->setOptionIfNotExist('ld_library_path', "LD_LIBRARY_PATH=\"/usr/local/musl/{$arch}-linux-musl/lib\"");
}