Linking pthreads optional 48/213648/1
authoradam.b <adam.b@samsung.com>
Mon, 9 Sep 2019 14:59:55 +0000 (15:59 +0100)
committeradam.b <adam.b@samsung.com>
Mon, 9 Sep 2019 14:59:55 +0000 (15:59 +0100)
Pthreads added to the linked libs only when exists.

Change-Id: Icfe78665bf00705f2d2ef53634095ea9e25d7789

build/tizen/CMakeLists.txt

index 4bb2198..5c2673b 100644 (file)
@@ -139,8 +139,14 @@ ENDIF()
 
 ADD_LIBRARY( ${name} ${LIBTYPE} ${SOURCES} )
 
+# pthread required due to gcc issue
+FIND_LIBRARY(PTHREAD pthread)
+IF(PTHREAD)
+  SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} -lpthread)
+ENDIF()
+
 TARGET_LINK_LIBRARIES( ${name}
-  -lpthread
+  ${OPTIONAL_LIBS}
   ${COVERAGE}
 )