use filter var instead of assuming var was defined in .env.ini

This commit is contained in:
Marc
2025-03-06 15:54:14 +07:00
committed by GitHub
parent 2868cb02f7
commit 7ee412798b

View File

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