diff mbox series

[meta-oe,1/5] freeglut: Add symbol link to fix opencl-cts compile error

Message ID 20260624095845.2294-2-zhengrq.fnst@fujitsu.com
State New
Headers show
Series freeglut: Bug fix and virtual/freeglut provide. | expand

Commit Message

Zheng Ruoqin June 24, 2026, 9:58 a.m. UTC
opencl-cts depends on freeglut which will cause can't find so file error as:
opencl-cts/2026.05.05/recipe-sysroot-native/usr/bin/aarch64-oe-linux/aarch64-oe-linux-ld: cannot find -lglut: No such file or directory

It was caused by the CMake definition in opencl-cts

In test_conformance/gl/CMakeLists.txt, it will always find glut file to link but the realname is libfreeglut-gles.so or libfreeglut.so.
  if(WIN32)
  ......
      list(APPEND CLConform_LIBRARIES opengl32 freeglut glew32)
  else(WIN32)
      list(APPEND CLConform_LIBRARIES  GL glut GLEW GLU)
  endif(WIN32)

So add symbol link for so file in freeglut.

Signed-off-by: Zheng Ruoqin <zhengrq.fnst@fujitsu.com>
---
 meta-oe/recipes-graphics/freeglut/freeglut_3.8.0.bb | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/meta-oe/recipes-graphics/freeglut/freeglut_3.8.0.bb b/meta-oe/recipes-graphics/freeglut/freeglut_3.8.0.bb
index a00519f0d7..7d1e8b6856 100644
--- a/meta-oe/recipes-graphics/freeglut/freeglut_3.8.0.bb
+++ b/meta-oe/recipes-graphics/freeglut/freeglut_3.8.0.bb
@@ -36,4 +36,9 @@  UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases"
 do_install:append() {
     # Remove buildpaths
     sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/cmake/FreeGLUT/FreeGLUTTargets.cmake
+    if [ -f "${D}${libdir}/libfreeglut-gles.so" ]; then
+        ln -sf libfreeglut-gles.so ${D}${libdir}/libglut.so
+    else
+        ln -sf libfreeglut.so ${D}${libdir}/libglut.so
+    fi
 }