From 7fb37a9be3163da514125d0a85c42fd1b3f8c27c Mon Sep 17 00:00:00 2001 From: Erwan BERNARD Date: Tue, 9 Apr 2019 16:25:32 +0200 Subject: [PATCH] [libpq] fix error at link time on linux --- ports/libpq/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ports/libpq/CMakeLists.txt b/ports/libpq/CMakeLists.txt index 68da9356c6..13c1293170 100644 --- a/ports/libpq/CMakeLists.txt +++ b/ports/libpq/CMakeLists.txt @@ -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)