From ccc153a2d8510a714445b2ba858b5e71ec7e7451 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sat, 22 Oct 2016 15:56:19 -0400 Subject: [PATCH] linux: always link to dl and pthread --- CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8dd0f0d..5096d13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -212,11 +212,11 @@ if (TBB_BUILD_SHARED) LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) + if (UNIX AND NOT APPLE) + target_link_libraries(tbb PUBLIC pthread dl) + endif() endif() -if (UNIX AND NOT APPLE) - target_link_libraries(tbb PUBLIC pthread dl) -endif() if(CMAKE_COMPILER_IS_GNUCC) # Quench a warning on GCC @@ -254,6 +254,9 @@ if(TBB_BUILD_TBBMALLOC) LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) + if (UNIX AND NOT APPLE) + target_link_libraries(tbbmalloc PUBLIC pthread dl) + endif() endif() endif() @@ -275,6 +278,9 @@ if(TBB_BUILD_TBBMALLOC_PROXY) LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) + if (UNIX AND NOT APPLE) + target_link_libraries(tbbmalloc_proxy PUBLIC pthread dl) + endif() endif() endif()