Use extra files instead of internal patch block for libyaml

This commit is contained in:
crazywhalecc
2024-06-30 22:33:03 +08:00
committed by Jerry Ma
parent d4da18e869
commit ba127f4e00
2 changed files with 28 additions and 39 deletions

View File

@@ -24,6 +24,7 @@ class SourcePatcher
FileSystem::addSourceExtractHook('sqlsrv', [SourcePatcher::class, 'patchSQLSRVWin32']);
FileSystem::addSourceExtractHook('pdo_sqlsrv', [SourcePatcher::class, 'patchSQLSRVWin32']);
FileSystem::addSourceExtractHook('yaml', [SourcePatcher::class, 'patchYamlWin32']);
FileSystem::addSourceExtractHook('libyaml', [SourcePatcher::class, 'patchLibYaml']);
}
/**
@@ -348,6 +349,18 @@ class SourcePatcher
return true;
}
public static function patchLibYaml(string $name, string $target): bool
{
if (!file_exists("{$target}\\cmake\\config.h.in")) {
FileSystem::createDir("{$target}\\cmake");
copy(ROOT_DIR . '\src\globals\extra\libyaml_config.h.in', "{$target}\\cmake\\config.h.in");
}
if (!file_exists("{$target}\\YamlConfig.cmake.in")) {
copy(ROOT_DIR . '\src\globals\extra\libyaml_YamlConfig.cmake.in', "{$target}\\YamlConfig.cmake.in");
}
return true;
}
/**
* Patch cli SAPI Makefile for Windows.
*