[Piglit] [PATCH v4] CMake: define GBM_BO_MAP only when symbol is found

Jan Vesely jan.vesely at rutgers.edu
Tue May 16 20:46:09 UTC 2017


On Tue, 2017-05-16 at 15:34 -0500, Daniel Díaz wrote:
> Hello!
> 
> 
> On 05/16/2017 03:06 PM, Jan Vesely wrote:
> > On Mon, 2017-05-15 at 20:27 -0500, Daniel Díaz wrote:
> > > diff --git a/CMakeLists.txt b/CMakeLists.txt index 
> > > a4ff99e..cc26fa8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
> > > @@ -141,8 +141,9 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
> > > if(GBM_FOUND) set(PIGLIT_HAS_GBM True) 
> > > add_definitions(-DPIGLIT_HAS_GBM) -		if (GBM_VERSION 
> > > VERSION_EQUAL "12.1" OR GBM_VERSION VERSION_GREATER "12.1") - 
> > > set(PIGLIT_HAS_GBM_BO_MAP True)
> > 
> > you still need to preserve the above line ^^, otherwise it breaks 
> > the check on line 197.
> 
> But it is still defined, right? The CheckSymbolExists module defines
> PIGLIT_HAS_GBM_BO_MAP which can be used in the condition down below,
> in true ("1") or false ("") form.

ah, right. I missed that you reuse the same variable name.
sorry for the noise. It forced me to dig a bit through cmake docs.
you can add my
Reviewed-by: Jan Vesely <jan.vesely at rutgers.edu>
if Dylan will take it.

Jan
> 
> This snippet (similar to line ~197) seems to work as expected:
>   CHECK_FUNCTION_EXISTS(bogus_fx BOGUS_COND)
>   if(False OR BOGUS_COND)
>           message(FATAL_ERROR "True here")
>   ELSE()
>           message(FATAL_ERROR "False here")
>   ENDIF()
> 
> Please let me know if I'm missing something.
> 
> Thanks and greetings
> 
> Daniel Díaz
> daniel.diaz at linaro.org
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20170516/62ddd162/attachment.sig>


More information about the Piglit mailing list