1From a312e82124fb8c9f139d5a40fa5a28123bb77a33 Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Sun, 10 Jan 2021 14:25:56 +0100
4Subject: [PATCH] arch/posix/CMakeLists.txt: fix build without threads
5
6Fix the following build failure without threads:
7
8[100%] Linking C shared library bin/libopen62541.so
9/home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: cannot find -lpthread
10collect2: error: ld returned 1 exit status
11CMakeFiles/open62541.dir/build.make:192: recipe for target 'bin/libopen62541.so.0.0.0' failed
12make[3]: *** [bin/libopen62541.so.0.0.0] Error 1
13
14Fixes:
15 - http://autobuild.buildroot.org/results/87ec3c987c991f790757276316d6caf81e635fa2
16
17Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
18---
19 arch/posix/CMakeLists.txt | 2 --
20 1 file changed, 2 deletions(-)
21
22diff --git a/arch/posix/CMakeLists.txt b/arch/posix/CMakeLists.txt
23index bb24757c..a53c9f2c 100644
24--- a/arch/posix/CMakeLists.txt
25+++ b/arch/posix/CMakeLists.txt
26@@ -20,8 +20,6 @@ if (${_index} GREATER -1 OR "${UA_ARCHITECTURE}" STREQUAL "posix")
27           ua_architecture_append_to_library(netdb ndblib socket)
28         else()
29           ua_architecture_append_to_library(m)
30-          #TODO - Error on first make run if pthread is included conditional?
31-          ua_architecture_append_to_library(pthread)
32           if(UA_MULTITHREADING OR UA_BUILD_UNIT_TESTS)
33             ua_architecture_append_to_library(pthread)
34           endif()
35--
362.29.2
37
38