2025-03-24 05:47:00 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\windows\library;
|
|
|
|
|
|
|
|
|
|
class postgresql_win extends WindowsLibraryBase
|
|
|
|
|
{
|
|
|
|
|
public const NAME = 'postgresql-win';
|
|
|
|
|
|
|
|
|
|
protected function build(): void
|
|
|
|
|
{
|
2026-04-14 11:25:15 +08:00
|
|
|
copy($this->source_dir . '\lib\libpq.lib', BUILD_LIB_PATH . '\libpq.lib');
|
|
|
|
|
copy($this->source_dir . '\lib\libpgport.lib', BUILD_LIB_PATH . '\libpgport.lib');
|
|
|
|
|
copy($this->source_dir . '\lib\libpgcommon.lib', BUILD_LIB_PATH . '\libpgcommon.lib');
|
2025-03-24 05:47:00 +01:00
|
|
|
|
|
|
|
|
// create libpq folder in buildroot/includes/libpq
|
|
|
|
|
if (!file_exists(BUILD_INCLUDE_PATH . '\libpq')) {
|
|
|
|
|
mkdir(BUILD_INCLUDE_PATH . '\libpq');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$headerFiles = ['libpq-fe.h', 'postgres_ext.h', 'pg_config_ext.h', 'libpq\libpq-fs.h'];
|
|
|
|
|
foreach ($headerFiles as $header) {
|
2026-04-14 11:25:15 +08:00
|
|
|
copy($this->source_dir . '\include\\' . $header, BUILD_INCLUDE_PATH . '\\' . $header);
|
2025-03-24 05:47:00 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|