cl: Use HAVE_RT to determine linking with rt.

Submitted by Vinson Lee on Nov. 4, 2016, 10:57 p.m.

Details

Message ID 1478300245-19667-1-git-send-email-vlee@freedesktop.org
State New
Headers show
Series "cl: Use HAVE_RT to determine linking with rt." ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Vinson Lee Nov. 4, 2016, 10:57 p.m.
Fix build error on Mac OS X.

Linking C executable ../../../../../bin/cl-custom-use-sub-buffer-in-kernel
ld: library not found for -lrt

Fixes: e34b54672cbb ("cl: Fix build on systems where clock_gettime is only avaiable in librt")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
---
 tests/cl/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/tests/cl/CMakeLists.txt b/tests/cl/CMakeLists.txt
index 9512fbd..6cdc1b8 100644
--- a/tests/cl/CMakeLists.txt
+++ b/tests/cl/CMakeLists.txt
@@ -8,7 +8,7 @@  link_libraries (
 	${OPENCL_opencl_LIBRARY}
 )
 
-if(PIGLIT_HAS_POSIX_CLOCK_MONOTONIC)
+if(HAVE_RT)
 	link_libraries(rt)
 endif()
 

Comments

On Friday 04 November 2016 22:57:25 Vinson Lee wrote:
> Fix build error on Mac OS X.
> 
> Linking C executable ../../../../../bin/cl-custom-use-sub-buffer-in-kernel
> ld: library not found for -lrt
> 
> Fixes: e34b54672cbb ("cl: Fix build on systems where clock_gettime is only
> avaiable in librt") Signed-off-by: Vinson Lee <vlee@freedesktop.org>
> ---
>  tests/cl/CMakeLists.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/cl/CMakeLists.txt b/tests/cl/CMakeLists.txt
> index 9512fbd..6cdc1b8 100644
> --- a/tests/cl/CMakeLists.txt
> +++ b/tests/cl/CMakeLists.txt
> @@ -8,7 +8,7 @@ link_libraries (
>  	${OPENCL_opencl_LIBRARY}
>  )
> 
> -if(PIGLIT_HAS_POSIX_CLOCK_MONOTONIC)
> +if(HAVE_RT)

Looks like it's HAVE_LIBRT.
And I think the test should be if(PIGLIT_HAS_POSIX_CLOCK_MONOTONIC AND 
HAVE_LIBRT) like in tests/util/CMakeLists.txt

With that changed
Reviewed-by: Serge Martin <edb+piglit@sigluy.net>

>  	link_libraries(rt)
>  endif()