From d93b810bc39ee5e7dc0a6cb0988ccc167c152646 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 27 May 2023 12:41:25 -0400 Subject: Separate pugl/glu.h from pugl/gl.h The GLU library is often shipped in a separate package, so it's possible to have a system with GL, but no GLU headers. Since use of GLU isn't universal (none of the examples use it), its inclusion can break builds that would otherwise work. So, move it to a separate wrapper header so this can be avoided. --- include/meson.build | 1 + include/pugl/gl.h | 11 ----------- include/pugl/glu.h | 22 ++++++++++++++++++++++ 3 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 include/pugl/glu.h (limited to 'include') diff --git a/include/meson.build b/include/meson.build index 2f31b3d..00d4aed 100644 --- a/include/meson.build +++ b/include/meson.build @@ -7,6 +7,7 @@ c_headers = [ 'pugl/cairo.h', 'pugl/gl.h', + 'pugl/glu.h', 'pugl/stub.h', 'pugl/vulkan.h', ] diff --git a/include/pugl/gl.h b/include/pugl/gl.h index 1298ff6..efb22f3 100644 --- a/include/pugl/gl.h +++ b/include/pugl/gl.h @@ -22,17 +22,6 @@ # endif #endif -#ifndef PUGL_NO_INCLUDE_GLU_H -# ifdef __APPLE__ -# include -# else -# ifdef _WIN32 -# include -# endif -# include -# endif -#endif - // IWYU pragma: end_exports PUGL_BEGIN_DECLS diff --git a/include/pugl/glu.h b/include/pugl/glu.h new file mode 100644 index 0000000..e709dfb --- /dev/null +++ b/include/pugl/glu.h @@ -0,0 +1,22 @@ +// Copyright 2012-2023 David Robillard +// SPDX-License-Identifier: ISC + +#ifndef PUGL_GLU_H +#define PUGL_GLU_H + +// IWYU pragma: begin_exports + +#ifndef PUGL_NO_INCLUDE_GLU_H +# ifdef __APPLE__ +# include +# else +# ifdef _WIN32 +# include +# endif +# include +# endif +#endif + +// IWYU pragma: end_exports + +#endif // PUGL_GLU_H -- cgit v1.2.1