aboutsummaryrefslogtreecommitdiff
path: root/paludis
diff options
context:
space:
mode:
authorAvatar Heiko Becker <heirecka@exherbo.org> 2016-12-12 21:18:00 +0100
committerAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2016-12-13 15:09:57 -0800
commitf1cb2cfd493f1cc06ea5965c07334e502decdccc (patch)
tree662778b4e89cbbe89ed286c5628880eccfa2f22d /paludis
parent07328ab9371e93e0c25313bd1ac5f982f65bf971 (diff)
downloadpaludis-f1cb2cfd493f1cc06ea5965c07334e502decdccc.tar.gz
paludis-f1cb2cfd493f1cc06ea5965c07334e502decdccc.tar.xz
build: Use the imported target for linking to pthread
Our required cmake version is new enough (>=3.1) and usage of the imported target is recommended by cmake's documentation [1]. Furthermore, according to the docs THREADS_PREFER_PTHREAD_FLAG can only be used with the imported target. [1] https://cmake.org/cmake/help/v3.7/module/FindThreads.html
Diffstat (limited to 'paludis')
-rw-r--r--paludis/CMakeLists.txt2
-rw-r--r--paludis/resolver/CMakeLists.txt2
-rw-r--r--paludis/util/CMakeLists.txt4
3 files changed, 4 insertions, 4 deletions
diff --git a/paludis/CMakeLists.txt b/paludis/CMakeLists.txt
index 8a67913..d713c65 100644
--- a/paludis/CMakeLists.txt
+++ b/paludis/CMakeLists.txt
@@ -209,7 +209,7 @@ target_link_libraries(libpaludis
libpaludisselinux
libpaludisutil
${CMAKE_DL_LIBS}
- ${CMAKE_THREAD_LIBS_INIT})
+ Threads::Threads)
add_dependencies(libpaludis ${paludis_hh_TARGET} ${paludis_util_hh_TARGET})
if(ENABLE_PYTHON)
diff --git a/paludis/resolver/CMakeLists.txt b/paludis/resolver/CMakeLists.txt
index 94ad784..5060cb9 100644
--- a/paludis/resolver/CMakeLists.txt
+++ b/paludis/resolver/CMakeLists.txt
@@ -88,7 +88,7 @@ paludis_add_library(libpaludisresolver
"${CMAKE_CURRENT_SOURCE_DIR}/use_existing.se")
target_link_libraries(libpaludisresolver
INTERFACE
- ${CMAKE_THREAD_LIBS_INIT})
+ Threads::Threads)
if(ENABLE_GTEST)
paludis_add_library(libpaludisresolvertest
diff --git a/paludis/util/CMakeLists.txt b/paludis/util/CMakeLists.txt
index 8b90e0a..50535ee 100644
--- a/paludis/util/CMakeLists.txt
+++ b/paludis/util/CMakeLists.txt
@@ -77,7 +77,7 @@ paludis_add_library(libpaludisutil
add_dependencies(libpaludisutil ${paludis_util_hh_TARGET})
target_link_libraries(libpaludisutil
PRIVATE
- ${CMAKE_THREAD_LIBS_INIT}
+ Threads::Threads
${CMAKE_DL_LIBS})
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/echo_functions.bash.in"
@@ -147,7 +147,7 @@ endforeach()
foreach(test buffer_output_stream;string_list_stream)
paludis_add_test(${test} GTEST
LINK_LIBRARIES
- ${CMAKE_THREAD_LIBS_INIT})
+ Threads::Threads)
endforeach()
install(TARGETS