summaryrefslogtreecommitdiff
blob: 95f8e998f58fbb8330e38e8b175ebdb9865a3846 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 5b79460bdda286ca988b39e93e446176e8a781d1 Mon Sep 17 00:00:00 2001
From: Neel Patel <neel.patel@enterprisedb.com>
Date: Fri, 20 Jul 2018 13:35:35 +0100
Subject: [PATCH] Link with pthreads on non-Windows and non-macOS platforms.

Patch based on feedback and initial work by Christoph Berg.
---
 CMakeLists.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1be24da..6f1eaa0 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -134,9 +134,15 @@ IF(WIN32)
 ENDIF(WIN32)
 
 ADD_EXECUTABLE(pgagent ${_srcs})
+IF(UNIX AND NOT APPLE)
+TARGET_LINK_LIBRARIES(
+        pgagent ${PG_LIBRARIES} ${Boost_LIBRARIES} -pthread
+)
+ELSE()
 TARGET_LINK_LIBRARIES(
         pgagent ${PG_LIBRARIES} ${Boost_LIBRARIES}
 )
+ENDIF()
 
 # Installation
 IF (WIN32)
-- 
2.24.1