diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-02-21 01:03:43 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-02-21 01:13:39 +0000 |
commit | ee53d96447c3b8cc13a897a567c0cd3fb76b0970 (patch) | |
tree | b5e03ac021c5f8d15f14b3ffa64979b5d46733e8 /CMakeLists.txt | |
parent | 9c079378e39b9a1b0ef70897388f75ac2ade711a (diff) |
Fix the windows build: pthread needs to be linked after vpx.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 41 |
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 | ||
235 | message("CMAKE_THREAD_LIBS_INIT: ${CMAKE_THREAD_LIBS_INIT}") | ||
236 | if(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}) | ||
239 | endif() | ||
240 | |||
241 | if(RT_LIBRARIES) | ||
242 | set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${RT_LIBRARIES}) | ||
243 | set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} "-lrt") | ||
244 | endif() | ||
245 | |||
246 | if(WIN32) | ||
247 | set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ws2_32 iphlpapi) | ||
248 | set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} "-lws2_32 -liphlpapi") | ||
249 | endif() | ||
250 | |||
251 | # LAYER 3: Distributed Hash Table | 235 | # LAYER 3: Distributed Hash Table |
252 | # ------------------------------- | 236 | # ------------------------------- |
253 | apidsl(toxcore/LAN_discovery.api.h) | 237 | apidsl(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. | ||
352 | message("CMAKE_THREAD_LIBS_INIT: ${CMAKE_THREAD_LIBS_INIT}") | ||
353 | if(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}) | ||
356 | endif() | ||
357 | |||
358 | if(RT_LIBRARIES) | ||
359 | set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${RT_LIBRARIES}) | ||
360 | set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} "-lrt") | ||
361 | endif() | ||
362 | |||
363 | if(WIN32) | ||
364 | set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ws2_32 iphlpapi) | ||
365 | set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} "-lws2_32 -liphlpapi") | ||
366 | endif() | ||
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 | ################################################################################ |