mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
* Caffe2 module update: move observers as well as binaries. * Add threads linkage * Add Threads dependency to public interface
18 lines
584 B
CMake
18 lines
584 B
CMake
find_package(Threads REQUIRED)
|
|
# For newer CMake, Threads::Threads is already defined. Otherwise, we will
|
|
# provide a backward compatible wrapper for Threads::Threads.
|
|
if(THREADS_FOUND AND NOT TARGET Threads::Threads)
|
|
add_library(Threads::Threads INTERFACE IMPORTED)
|
|
|
|
if(THREADS_HAVE_PTHREAD_ARG)
|
|
set_property(
|
|
TARGET Threads::Threads
|
|
PROPERTY INTERFACE_COMPILE_OPTIONS "-pthread")
|
|
endif()
|
|
|
|
if(CMAKE_THREAD_LIBS_INIT)
|
|
set_property(
|
|
TARGET Threads::Threads
|
|
PROPERTY INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
|
|
endif()
|
|
endif() |