Merge pull request #6016 from edmBernard/dev/fix_libpq_on_linux

[libpq] fix error at link time on linux
This commit is contained in:
Griffin Downs 2019-04-12 08:20:23 -07:00 committed by GitHub
commit 0bfa4c82b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -66,6 +66,9 @@ if(WIN32)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND pg_port_src
src/port/strlcpy.c
src/port/inet_aton.c
src/port/inet_net_ntop.c
src/port/getpeereid.c
)
endif()
@ -130,7 +133,12 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_DEBUG_POSTFIX "d")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_library(libpq ${pg_port_src} ${pg_backend_src} ${pg_libpq_src})
target_compile_definitions(libpq PRIVATE -DFRONTEND -DENABLE_THREAD_SAFETY -DUSE_OPENSSL -D_CRT_SECURE_NO_WARNINGS)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_compile_definitions(libpq PRIVATE -D_GNU_SOURCE)
endif()
target_link_libraries(libpq PRIVATE OpenSSL::SSL)
if(WIN32)
target_link_libraries(libpq PRIVATE ws2_32 secur32 advapi32 shell32)

View File

@ -1,4 +1,4 @@
Source: libpq
Version: 9.6.1-5
Version: 9.6.1-6
Description: The official database access API of postgresql
Build-Depends: openssl, zlib (linux)