$OpenBSD: patch-CMakeLists_txt,v 1.1.1.1 2018/01/14 21:49:14 sthen Exp $

From FreeBSD
include same flags for OpenBSD

Index: CMakeLists.txt
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -33,7 +33,7 @@ if(X11_FOUND)
 	add_definitions(-DPIGLIT_HAS_X11)
 endif()
 
-if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
 	set(PIGLIT_BUILD_GLES_TESTS_DEFAULT ON)
 else()
 	set(PIGLIT_BUILD_GLES_TESTS_DEFAULT OFF)
@@ -49,7 +49,7 @@ if(PIGLIT_BUILD_GL_TESTS)
 	find_package(OpenGL REQUIRED)
 endif()
 
-if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
 	option(PIGLIT_USE_WAFFLE "Use Waffle in place of GLUT" ON)
 else()
 	option(PIGLIT_USE_WAFFLE "Use Waffle in place of GLUT" OFF)
@@ -128,7 +128,7 @@ if(PIGLIT_BUILD_CL_TESTS)
 	find_package(OpenCL REQUIRED)
 endif(PIGLIT_BUILD_CL_TESTS)
 
-IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
 	if(X11_FOUND AND OPENGL_gl_LIBRARY)
 		# Assume the system has GLX. In the future, systems may exist
 		# with libGL and libX11 but no GLX, but that world hasn't
@@ -222,8 +222,6 @@ IF(PIGLIT_BUILD_GLX_TESTS)
 	pkg_check_modules(GLPROTO REQUIRED glproto)
 ENDIF()
 
-set(Python_ADDITIONAL_VERSIONS
-    3.6 3.5 3.4 3.3 2.7)
 find_package(PythonInterp REQUIRED)
 find_package(PythonSix 1.5.2 REQUIRED)
 find_package(PythonNumpy 1.7.0 REQUIRED)
@@ -382,7 +380,7 @@ endif()
 
 check_c_source_compiles(
 	"
-	#define _POSIX_C_SOURCE 199309L
+	#define _POSIX_C_SOURCE 200112L
 	#include <time.h>
 	int main() { return clock_gettime(CLOCK_MONOTONIC, NULL); }
 	"
@@ -426,7 +424,7 @@ if(HAVE_LIBCACA)
 endif(HAVE_LIBCACA)
 endif(GBM_FOUND)
 
-if(PIGLIT_USE_WAFFLE AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+if(PIGLIT_USE_WAFFLE AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
 	pkg_check_modules(EGL egl>=11.0)
 endif()
 
