diff options
-rw-r--r-- | CMakeLists.txt | 18 | ||||
-rw-r--r-- | cmake/ModulePackage.cmake | 12 |
2 files changed, 15 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cea97fce..d14538d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -215,6 +215,18 @@ endif() | |||
215 | # | 215 | # |
216 | ################################################################################ | 216 | ################################################################################ |
217 | 217 | ||
218 | # toxcore_PKGCONFIG_LIBS is what's added to the Libs: line in toxcore.pc. It | ||
219 | # needs to contain all the libraries a program using toxcore should link against | ||
220 | # if it's statically linked. If it's dynamically linked, there is no need to | ||
221 | # explicitly link against all the dependencies, but it doesn't harm much(*) | ||
222 | # either. | ||
223 | # | ||
224 | # (*) It allows client code to use symbols from our dependencies without | ||
225 | # explicitly linking against them. | ||
226 | set(toxcore_PKGCONFIG_LIBS) | ||
227 | # Requires: in pkg-config file. | ||
228 | set(toxcore_PKGCONFIG_REQUIRES) | ||
229 | |||
218 | # LAYER 1: Crypto core | 230 | # LAYER 1: Crypto core |
219 | # -------------------- | 231 | # -------------------- |
220 | apidsl(toxcore/crypto_core.api.h) | 232 | apidsl(toxcore/crypto_core.api.h) |
@@ -227,7 +239,7 @@ include(CheckFunctionExists) | |||
227 | check_function_exists(explicit_bzero HAVE_EXPLICIT_BZERO) | 239 | check_function_exists(explicit_bzero HAVE_EXPLICIT_BZERO) |
228 | check_function_exists(memset_s HAVE_MEMSET_S) | 240 | check_function_exists(memset_s HAVE_MEMSET_S) |
229 | set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${LIBSODIUM_LIBRARIES}) | 241 | set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${LIBSODIUM_LIBRARIES}) |
230 | set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} libsodium) | 242 | set(toxcore_PKGCONFIG_REQUIRES ${toxcore_PKGCONFIG_REQUIRES} libsodium) |
231 | 243 | ||
232 | # LAYER 2: Basic networking | 244 | # LAYER 2: Basic networking |
233 | # ------------------------- | 245 | # ------------------------- |
@@ -364,12 +376,12 @@ endif() | |||
364 | 376 | ||
365 | if(RT_LIBRARIES) | 377 | if(RT_LIBRARIES) |
366 | set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${RT_LIBRARIES}) | 378 | set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ${RT_LIBRARIES}) |
367 | set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} "-lrt") | 379 | set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} -lrt) |
368 | endif() | 380 | endif() |
369 | 381 | ||
370 | if(WIN32) | 382 | if(WIN32) |
371 | set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ws2_32 iphlpapi) | 383 | set(toxcore_LINK_MODULES ${toxcore_LINK_MODULES} ws2_32 iphlpapi) |
372 | set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} "-lws2_32 -liphlpapi") | 384 | set(toxcore_PKGCONFIG_LIBS ${toxcore_PKGCONFIG_LIBS} -lws2_32 -liphlpapi) |
373 | endif() | 385 | endif() |
374 | 386 | ||
375 | ################################################################################ | 387 | ################################################################################ |
diff --git a/cmake/ModulePackage.cmake b/cmake/ModulePackage.cmake index f0eef7c9..77911b1d 100644 --- a/cmake/ModulePackage.cmake +++ b/cmake/ModulePackage.cmake | |||
@@ -39,18 +39,6 @@ function(add_module lib) | |||
39 | add_library(${lib}_static STATIC ${ARGN}) | 39 | add_library(${lib}_static STATIC ${ARGN}) |
40 | set_target_properties(${lib}_static PROPERTIES OUTPUT_NAME ${lib}) | 40 | set_target_properties(${lib}_static PROPERTIES OUTPUT_NAME ${lib}) |
41 | endif() | 41 | endif() |
42 | |||
43 | # ${lib}_PKGCONFIG_LIBS is what's added to the Libs: line in ${lib}.pc. It | ||
44 | # needs to contain all the libraries a program using ${lib} should link against | ||
45 | # if it's statically linked. If it's dynamically linked, there is no need to | ||
46 | # explicitly link against all the dependencies, but it doesn't harm much(*) | ||
47 | # either. | ||
48 | # | ||
49 | # (*) It allows client code to use symbols from our dependencies without | ||
50 | # explicitly linking against them. | ||
51 | set(${lib}_PKGCONFIG_LIBS PARENT_SCOPE) | ||
52 | # Requires: in pkg-config file. | ||
53 | set(${lib}_PKGCONFIG_REQUIRES PARENT_SCOPE) | ||
54 | endfunction() | 42 | endfunction() |
55 | 43 | ||
56 | function(install_module lib) | 44 | function(install_module lib) |