summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-02-21 01:03:43 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-02-21 01:13:39 +0000
commitee53d96447c3b8cc13a897a567c0cd3fb76b0970 (patch)
treeb5e03ac021c5f8d15f14b3ffa64979b5d46733e8 /CMakeLists.txt
parent9c079378e39b9a1b0ef70897388f75ac2ade711a (diff)
Fix the windows build: pthread needs to be linked after vpx.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt41
1 files changed, 25 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1aee8017..3262471b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -232,22 +232,6 @@ set(toxcore_SOURCES ${toxcore_SOURCES}
232 toxcore/util.c 232 toxcore/util.c
233 toxcore/util.h) 233 toxcore/util.h)
234 234
235message("CMAKE_THREAD_LIBS_INIT: ${CMAKE_THREAD_LIBS_INIT}")
236if(CMAKE_THREAD_LIBS_INIT)
237 set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${CMAKE_THREAD_LIBS_INIT})
238 set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} ${CMAKE_THREAD_LIBS_INIT})
239endif()
240
241if(RT_LIBRARIES)
242 set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${RT_LIBRARIES})
243 set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} "-lrt")
244endif()
245
246if(WIN32)
247 set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ws2_32 iphlpapi)
248 set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} "-lws2_32 -liphlpapi")
249endif()
250
251# LAYER 3: Distributed Hash Table 235# LAYER 3: Distributed Hash Table
252# ------------------------------- 236# -------------------------------
253apidsl(toxcore/LAN_discovery.api.h) 237apidsl(toxcore/LAN_discovery.api.h)
@@ -358,6 +342,31 @@ set(toxcore_API_HEADERS ${toxcore_API_HEADERS} ${toxcore_SOURCE_DIR}/toxencrypts
358 342
359################################################################################ 343################################################################################
360# 344#
345# :: System dependencies
346#
347################################################################################
348
349# These need to come after other dependencies, since e.g. libvpx may depend on
350# pthread, but doesn't list it in VPX_LIBRARIES. We're adding it here, after
351# any potential libvpx linking.
352message("CMAKE_THREAD_LIBS_INIT: ${CMAKE_THREAD_LIBS_INIT}")
353if(CMAKE_THREAD_LIBS_INIT)
354 set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${CMAKE_THREAD_LIBS_INIT})
355 set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} ${CMAKE_THREAD_LIBS_INIT})
356endif()
357
358if(RT_LIBRARIES)
359 set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${RT_LIBRARIES})
360 set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} "-lrt")
361endif()
362
363if(WIN32)
364 set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ws2_32 iphlpapi)
365 set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} "-lws2_32 -liphlpapi")
366endif()
367
368################################################################################
369#
361# :: All layers together in one library for ease of use 370# :: All layers together in one library for ease of use
362# 371#
363################################################################################ 372################################################################################