[Piglit] [Patch v2 3/3] CMakeLists.txt: Use FindWaffle.cmake instead of pkg-find

Emil Velikov emil.l.velikov at gmail.com
Mon Dec 15 11:45:49 PST 2014


On 15/12/14 18:56, Dylan Baker wrote:
> This is nice because it should work on both windows and on linux, since
> FindWaffle is provided by waffle itself.
> 
> This is tested on Linux, but not on Windows.
> 
> NOTE: There is a bug in FindWaffle.cmake that causes it to never check
> that the requested version is present. There is a patch on the waffle
> list for this problem.
> 
> Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> ---
>  CMakeLists.txt | 26 +-------------------------
>  1 file changed, 1 insertion(+), 25 deletions(-)
> 
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index e85bb37..200dbbf 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -42,31 +42,7 @@ else()
>  endif()
>  
>  if(PIGLIT_USE_WAFFLE)
> -	if (NOT MSVC)
> -		pkg_check_modules(WAFFLE REQUIRED waffle-1)
> -
> -		if(NOT WAFFLE_FOUND)
> -			message(FATAL_ERROR "Failed to find Waffle. If Waffle"
> -			"is not packaged for your distribution, you can get "
> -			"it at http://www.waffle-gl.org."
> -		)
> -		endif()
> -	endif ()
> -
> -	# Check the installed waffle version.
> -	#
> -	# We cannot reliably check the version with pkg_check_modules(), but
> -	# instead must check the version manually as below. The problem is that,
> -	# if one passes a required version to pkg_check_modules(), CMake
> -	# validates the required version at most once for the lifetime of the
> -	# source tree.  If someone changes the required version by editing the
> -	# CMakeLists, CMake fails to detect the new requirement.
> -	set(WAFFLE_REQUIRED_VERSION "1.3.0")
> -	if(WAFFLE_VERSION VERSION_LESS WAFFLE_REQUIRED_VERSION)
> -		message(FATAL_ERROR "Found waffle-${WAFFLE_VERSION}, but "
> -		"piglit requires waffle-${WAFFLE_REQUIRED_VERSION}")
> -	endif()
> -
> +	find_package(Waffle, 1.3.0 REQUIRED)
You'll need to rebase your tree - the version should read 1.5.0.

Wrt linux testing I would recommend removing your local (system wide)
waffle and building/installing it in a custom prefix.

With the help of waffle/pkg/archlinux/mingw-w64-waffle/PKGBUILD you can
get a mingw version of waffle to cross-compile it. Glancing inside will
guide you how to run/do the piglit cross build.

-Emil



More information about the Piglit mailing list