logo

blog

My website can't be that messy, right? git clone https://hacktivis.me/git/blog.git
commit: bfbd368bc4602d0c4c493c3b3cc153e2368cc2da
parent 1fe9fb29734f55527c30ad8a396d621438e4860a
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed, 10 Mar 2021 14:47:17 +0100

notes/pure-wayland: Add buildsystem snippets

Diffstat:

Mnotes/pure-wayland.shtml22++++++++++++++++++++++
1 file changed, 22 insertions(+), 0 deletions(-)

diff --git a/notes/pure-wayland.shtml b/notes/pure-wayland.shtml @@ -22,6 +22,28 @@ </dl> </p> + <h2>Buildsystems</h2> + <p>I've yet to see one work correctly out of the box for this. The snippets in this section Abandons all copyrights if it could even begin to be copyrightable, sadly Public Domain doesn't exists in France so, they are distributed under any OSI/FSF-approuved license including CC-0, WTFPL, Unlicense and BSD-0.</p> + <h3>CMake</h3> + <ol> + <li>Replace <code>find_package(OpenGL REQUIRED)</code> to something like <code>find_package(OpenGL COMPONENTS OpenGL REQUIRED)</code>. This allows to not error out when libGL.so isn't found but libOpenGL.so is.</li> + <li>Replace <code>OPENGL_gl_LIBRARY</code> to <code>OPENGL_opengl_LIBRARY</code>. This will allow to use libOpenGL.so over libGL.so when possible.</li> + </ol> + <h3>Auto*hell</h3> + <p>Use something like the following:</p> +<pre><code>AC_CHECK_HEADER( + [GL/gl.h], + AC_SEARCH_LIBS(glBegin, [opengl32 GL GL2 OpenGL], [test $ac_cv_search_glBegin = "none required" || GL_LIBS="$ac_cv_search_glBegin $GL_LIBS"], [AC_MSG_ERROR(*** OpenGL library not found on system!)]), + [AC_MSG_ERROR(*** OpenGL headers not found on system!)] +)</code></pre> + <h3>meson</h3> + <p>Nice fail of an otherwise nice mainly declarative buildsystem thereā€¦</p> +<pre><code>gl_dep = dependency('gl', required: false) +if not gl_dep.found() + # libglvnd fallback for libX11-less wayland systems + gl_dep = dependency('opengl') +endif</code></pre> + <h2>Librairies</h2> <ul> <li><a href="https://www.gtk.org/">GTK</a> 3 and later: Yes, Just Works</li>