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

Chad Versace chad.versace at linux.intel.com
Wed Oct 30 20:51:52 CET 2013


On 10/30/2013 12:42 PM, Tom Stellard wrote:
> 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)
>

Reviewed-by: Chad Versace <chad.versace at linux.intel.com>


More information about the Piglit mailing list