use pkgconfig to determine libs

This commit is contained in:
DubbleClick
2025-07-21 12:10:14 +07:00
parent 1f7d3ec91d
commit bf4b35aa0a
5 changed files with 51 additions and 7 deletions

View File

@@ -4,10 +4,21 @@ declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\store\FileSystem;
use SPC\util\executor\UnixCMakeExecutor;
trait grpc
{
public function patchBeforeBuild(): bool
{
FileSystem::replaceFileStr(
$this->source_dir . '/third_party/re2/util/pcre.h',
["#define UTIL_PCRE_H_\n#include <stdint.h>", "#define UTIL_PCRE_H_"],
["#define UTIL_PCRE_H_", "#define UTIL_PCRE_H_\n#include <stdint.h>"],
);
return true;
}
protected function build(): void
{
UnixCMakeExecutor::create($this)