Fix link error due to pthread being linked in the wrong order
authorRob Hughes <robert.hughes@arm.com>
Wed, 13 Nov 2019 11:41:36 +0000 (11:41 +0000)
committerRob Hughes <robert.hughes@arm.com>
Thu, 14 Nov 2019 10:47:03 +0000 (10:47 +0000)
Change-Id: I9602c758fe462b65d67de491d91fb2392b09b8bd
Signed-off-by: Robert Hughes <robert.hughes@arm.com>
CMakeLists.txt

index 6856da6..89f0e5a 100644 (file)
@@ -564,7 +564,7 @@ if(ARMCOMPUTECL)
     target_link_libraries(armnn ${OPENCL_LIBRARIES})
 endif()
 
-if(PROFILING_BACKEND_STREAMLINE)
+if(PROFILING_BACKEND_STREAMLINE AND (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android)))
     target_link_libraries(armnn pthread)
 endif()
 
@@ -951,14 +951,14 @@ if(BUILD_GATORD_MOCK)
 
     add_executable_ex(GartordMock tests/profiling/gatordmock/GatordMockMain.cpp)
 
-    if(Threads_FOUND AND (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android)))
-        target_link_libraries(GartordMock pthread)
-    endif()
-
     target_link_libraries(GartordMock
         armnn
         gatordMockService
         ${Boost_PROGRAM_OPTIONS_LIBRARY}
         ${Boost_SYSTEM_LIBRARY})
 
+    if(Threads_FOUND AND (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android)))
+        target_link_libraries(GartordMock pthread)
+    endif()
+
 endif()