Fix librt linking on systems which has it (#331)

This commit is contained in:
Alt 2017-01-13 19:41:29 +03:00 committed by Dominic Hamon
parent 4bf28e611b
commit 34010beecb

View File

@ -21,6 +21,10 @@ set_target_properties(benchmark PROPERTIES
# Link threads.
target_link_libraries(benchmark ${BENCHMARK_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
find_library(LIBRT rt)
if(LIBRT)
target_link_libraries(benchmark ${LIBRT})
endif()
# We need extra libraries on Windows
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")