Browse Source

adding pthreads to the linker

Rob Parolin 6 years ago
parent
commit
6572f479ab
1 changed files with 9 additions and 0 deletions
  1. 9 0
      test/CMakeLists.txt

+ 9 - 0
test/CMakeLists.txt

@@ -58,6 +58,15 @@ target_link_libraries(EAThreadTest EAStdC)
 target_link_libraries(EAThreadTest EATest)
 target_link_libraries(EAThreadTest EAThread)
 
+set(THREADS_PREFER_PTHREAD_FLAG ON)
+find_package(Threads REQUIRED)
+
+if((NOT APPLE) AND (NOT WIN32))
+    target_link_libraries(EAStdCTest ${EASTLTest_Libraries} Threads::Threads rt)
+else()
+    target_link_libraries(EAStdCTest ${EASTLTest_Libraries} Threads::Threads)
+endif()
+
 #-------------------------------------------------------------------------------------------
 # Run Unit tests and verify the results.
 #-------------------------------------------------------------------------------------------