Add XXX_CXXFLAGS for common build

This commit is contained in:
crazywhalecc 2025-06-09 11:13:54 +08:00
parent 0558d67240
commit 1c1f7b19dd
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 10 additions and 0 deletions

View File

@ -118,4 +118,13 @@ trait UnixLibraryTrait
{
return getenv($this->getSnakeCaseName() . '_LIBS') ?: '';
}
public function getLibExtraCXXFlags(): string
{
$env = getenv($this->getSnakeCaseName() . '_CXXFLAGS') ?: '';
if (!str_contains($env, $this->builder->arch_cxx_flags)) {
$env .= $this->builder->arch_cxx_flags;
}
return $env;
}
}

View File

@ -70,6 +70,7 @@ class UnixShell
'CFLAGS' => $library->getLibExtraCFlags(),
'LDFLAGS' => $library->getLibExtraLdFlags(),
'LIBS' => $library->getLibExtraLibs(),
'CXXFLAGS' => $library->getLibExtraCXXFlags(),
]);
return $this;
}