| 1 |
# Copyright (c) 2022-2025, PostgreSQL Global Development Group |
| 2 |
|
| 3 |
ecpg_pgtypes_sources = files( |
| 4 |
'common.c', |
| 5 |
'datetime.c', |
| 6 |
'dt_common.c', |
| 7 |
'interval.c', |
| 8 |
'numeric.c', |
| 9 |
'timestamp.c', |
| 10 |
) |
| 11 |
ecpg_pgtypes_so_sources = [] # for shared lib, in addition to the above |
| 12 |
|
| 13 |
export_file = custom_target('libpgtypes.exports', kwargs: gen_export_kwargs) |
| 14 |
ecpg_pgtypes_inc = [include_directories('.'), ecpg_inc] |
| 15 |
ecpg_pgtypes_c_args = ['-DSO_MAJOR_VERSION=3'] |
| 16 |
|
| 17 |
if host_system == 'windows' |
| 18 |
ecpg_pgtypes_so_sources += rc_lib_gen.process(win32ver_rc, extra_args: [ |
| 19 |
'--NAME', 'pgtypes', |
| 20 |
'--FILEDESC', 'pgtypes - library for data type mapping',]) |
| 21 |
endif |
| 22 |
|
| 23 |
# see src/interfaces/libpq/meson.build |
| 24 |
ecpg_pgtypes_st = static_library('libpgtypes', |
| 25 |
ecpg_pgtypes_sources, |
| 26 |
include_directories: ecpg_pgtypes_inc, |
| 27 |
c_args: ecpg_pgtypes_c_args, |
| 28 |
c_pch: pch_postgres_fe_h, |
| 29 |
dependencies: frontend_stlib_code, |
| 30 |
kwargs: default_lib_args, |
| 31 |
) |
| 32 |
ecpg_targets += ecpg_pgtypes_st |
| 33 |
|
| 34 |
ecpg_pgtypes_so = shared_library('libpgtypes', |
| 35 |
ecpg_pgtypes_sources + ecpg_pgtypes_so_sources, |
| 36 |
include_directories: ecpg_pgtypes_inc, |
| 37 |
c_args: ecpg_pgtypes_c_args, |
| 38 |
c_pch: pch_postgres_fe_h, |
| 39 |
dependencies: frontend_shlib_code, |
| 40 |
version: '3.' + pg_version_major.to_string(), |
| 41 |
soversion: host_system != 'windows' ? '3' : '', |
| 42 |
darwin_versions: ['3', '3.' + pg_version_major.to_string()], |
| 43 |
link_args: export_fmt.format(export_file.full_path()), |
| 44 |
link_depends: export_file, |
| 45 |
kwargs: default_lib_args, |
| 46 |
) |
| 47 |
ecpg_targets += ecpg_pgtypes_so |
| 48 |
|
| 49 |
pkgconfig.generate( |
| 50 |
name: 'libpgtypes', |
| 51 |
description: 'PostgreSQL libpgtypes library', |
| 52 |
url: pg_url, |
| 53 |
libraries: ecpg_pgtypes_so, |
| 54 |
libraries_private: [frontend_stlib_code], |
| 55 |
) |