summaryrefslogtreecommitdiffstats
path: root/external/meta-openembedded/meta-oe/recipes-connectivity/zeromq/files/0001-CMakeLists-txt-Avoid-host-specific-path-to-libsodium.patch
blob: eb3dee4d31d5fe56653cdd3a2890f7a66c5ebeb3 (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
34
35
36
37
38
39
From: Niko Mauno <niko.mauno@vaisala.com>
Date: Wed Apr 22 09:00:00 2020 +0300
Subject: CMakeLists.txt: Avoid host-specific path to libsodium

Avoid propagating full build host specific path to generated
ZeroMQTargets.cmake when building with libsodium, which changes the
content in generated ZeroMQTargets.cmake files followingly:

  -INTERFACE_LINK_LIBRARIES "-lpthread;/build/host/specific/path/to/zeromq/4.3.2-r0/recipe-sysroot/usr/lib/libsodium.so;-lrt"
  +INTERFACE_LINK_LIBRARIES "-lpthread;-lsodium;-lrt"

This change mitigates an issue stemming from reuse of build artifacts
where the path to libsodium.so does not match exactly between two
different build hosts.

Upstream-Status: Pending

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1210,7 +1210,7 @@
   target_link_libraries(libzmq ${OPTIONAL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
 
   if(SODIUM_FOUND)
-    target_link_libraries(libzmq ${SODIUM_LIBRARIES})
+    target_link_libraries(libzmq -lsodium)
     # On Solaris, libsodium depends on libssp
     if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
       target_link_libraries(libzmq ssp)
@@ -1240,7 +1240,7 @@
   target_link_libraries(libzmq-static ${OPTIONAL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
 
   if(SODIUM_FOUND)
-    target_link_libraries(libzmq-static ${SODIUM_LIBRARIES})
+    target_link_libraries(libzmq-static -lsodium)
     # On Solaris, libsodium depends on libssp
     if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
       target_link_libraries(libzmq-static ssp)