aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--cmake/modules/PaludisAddTest.cmake2
-rw-r--r--paludis/CMakeLists.txt2
-rw-r--r--paludis/resolver/CMakeLists.txt2
-rw-r--r--paludis/util/CMakeLists.txt4
-rw-r--r--pkg-config/CMakeLists.txt2
-rw-r--r--ruby/CMakeLists.txt2
6 files changed, 7 insertions, 7 deletions
diff --git a/cmake/modules/PaludisAddTest.cmake b/cmake/modules/PaludisAddTest.cmake
index 104b2a9b3..09fde5008 100644
--- a/cmake/modules/PaludisAddTest.cmake
+++ b/cmake/modules/PaludisAddTest.cmake
@@ -30,7 +30,7 @@ function(paludis_add_test test_name)
libpaludis
libpaludisutil
${GTEST_BOTH_LIBRARIES}
- ${CMAKE_THREAD_LIBS_INIT}
+ Threads::Threads
${PAT_LINK_LIBRARIES})
endif()
diff --git a/paludis/CMakeLists.txt b/paludis/CMakeLists.txt
index 8a67913a0..d713c65a5 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 94ad7847f..5060cb9ba 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 8b90e0a15..50535eebc 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
diff --git a/pkg-config/CMakeLists.txt b/pkg-config/CMakeLists.txt
index abd0cf777..5137a4161 100644
--- a/pkg-config/CMakeLists.txt
+++ b/pkg-config/CMakeLists.txt
@@ -1,7 +1,7 @@
set(PALUDIS_PKG_CONFIG_CFLAGS)
set(PALUDIS_PKG_CONFIG_LIBS
- "-lpaludis_${PALUDIS_PKG_CONFIG_SLOT} -lpaludisutil_${PALUDIS_PKG_CONFIG_SLOT} -lpaludisargs_${PALUDIS_PKG_CONFIG_SLOT} ${CMAKE_THREAD_LIBS_INIT}")
+ "-lpaludis_${PALUDIS_PKG_CONFIG_SLOT} -lpaludisutil_${PALUDIS_PKG_CONFIG_SLOT} -lpaludisargs_${PALUDIS_PKG_CONFIG_SLOT} Threads::Threads")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/paludis.pc.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/paludis.pc"
diff --git a/ruby/CMakeLists.txt b/ruby/CMakeLists.txt
index 99ab61379..5c80f3484 100644
--- a/ruby/CMakeLists.txt
+++ b/ruby/CMakeLists.txt
@@ -32,7 +32,7 @@ if(ENABLE_RUBY)
PRIVATE
libpaludis
libpaludisutil
- ${CMAKE_THREAD_LIBS_INIT})
+ Threads::Threads)
paludis_add_library(Paludis UNVERSIONED SHARED_LIBRARY
"${CMAKE_CURRENT_SOURCE_DIR}/paludis_ruby_so.cc")