mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-04 07:15:38 +08:00
* Add pgsql extension for Windows <#664> * Add pgsql to windows test * Added pdo_pgsql for windows, added missing header files * Adjust some configure args and deps --------- Co-authored-by: crazywhalecc <jesse2061@outlook.com>
28 lines
939 B
PHP
28 lines
939 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace SPC\builder\windows\library;
|
|
|
|
class postgresql_win extends WindowsLibraryBase
|
|
{
|
|
public const NAME = 'postgresql-win';
|
|
|
|
protected function build(): void
|
|
{
|
|
copy($this->source_dir . '\pgsql\lib\libpq.lib', BUILD_LIB_PATH . '\libpq.lib');
|
|
copy($this->source_dir . '\pgsql\lib\libpgport.lib', BUILD_LIB_PATH . '\libpgport.lib');
|
|
copy($this->source_dir . '\pgsql\lib\libpgcommon.lib', BUILD_LIB_PATH . '\libpgcommon.lib');
|
|
|
|
// 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) {
|
|
copy($this->source_dir . '\pgsql\include\\' . $header, BUILD_INCLUDE_PATH . '\\' . $header);
|
|
}
|
|
}
|
|
}
|