[Piglit] [PATCH] cl: Fix build on systems where clock_gettime is only avaiable in librt

Tom Stellard tom at stellard.net
Wed Oct 30 20:42:59 CET 2013


From: Tom Stellard <thomas.stellard at amd.com>

clock_gettime is available in glibc 2.17 and newer, but anyone using
an older version of glibc must link against librt.
---
 tests/cl/CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/cl/CMakeLists.txt b/tests/cl/CMakeLists.txt
index b91eda5..53409ad 100644
--- a/tests/cl/CMakeLists.txt
+++ b/tests/cl/CMakeLists.txt
@@ -8,6 +8,10 @@ link_libraries (
 	${OPENCL_opencl_LIBRARY}
 )
 
+if(PIGLIT_HAS_POSIX_CLOCK_MONOTONIC)
+    link_libraries(rt)
+endif()
+
 function(piglit_cl_add_test)
     add_executable(${ARGV})
 endfunction(piglit_cl_add_test)
-- 
1.8.1.4



More information about the Piglit mailing list