1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-27 22:56:53 +03:00

meson: Add support for detecting ossp-uuid without pkg-config

This is necessary as ossp-uuid on windows installs neither a pkg-config nor a
cmake dependency information. Nor is there another supported uuid
implementation available on windows.

Reported-by: Dave Page <dpage@pgadmin.org>
Reviewed-by: Tristan Partin <tristan@partin.io>
Discussion: https://postgr.es/m/20240709065101.xhc74r3mdg2lmn4w@awork3.anarazel.de
Backpatch: 16-, where meson support was added
This commit is contained in:
Andres Freund 2024-07-20 13:51:08 -07:00
parent 7ed2ce0b25
commit 2416fdb3ee

View File

@ -1386,9 +1386,26 @@ if uuidopt != 'none'
uuidfunc = 'uuid_to_string' uuidfunc = 'uuid_to_string'
uuidheader = 'uuid.h' uuidheader = 'uuid.h'
elif uuidopt == 'ossp' elif uuidopt == 'ossp'
uuid = dependency('ossp-uuid', required: true) uuid = dependency('ossp-uuid', required: false)
uuidfunc = 'uuid_export' uuidfunc = 'uuid_export'
uuidheader = 'uuid.h' uuidheader = 'uuid.h'
# Hardcoded lookup for ossp-uuid. This is necessary as ossp-uuid on
# windows installs neither a pkg-config nor a cmake dependency
# information. Nor is there another supported uuid implementation
# available on windows.
#
# Sometimes the ossp-uuid library is named 'uuid' sometimes 'ossp-uuid'
if not uuid.found()
uuid = cc.find_library('ossp-uuid',
required: false, dirs: test_lib_d,
has_headers: uuidheader, header_include_directories: postgres_inc)
endif
if not uuid.found()
uuid = cc.find_library('uuid',
required: true, dirs: test_lib_d,
has_headers: uuidheader, header_include_directories: postgres_inc)
endif
else else
error('unknown uuid build option value: @0@'.format(uuidopt)) error('unknown uuid build option value: @0@'.format(uuidopt))
endif endif