Skip to content

Restore macOS GLU detection and test runtime loading - #83

Merged
tritao merged 2 commits into
freecad-masterfrom
fix/restore-macos-glu-header-detection
Sep 20, 2026
Merged

tritao merged 2 commits into
freecad-masterfrom
fix/restore-macos-glu-header-detection

Conversation

@tritao

@tritao tritao commented Sep 2, 2026 •

Copy link
Copy Markdown
Collaborator

This fixes a regression in the latest FreeCAD macOS weekly build, identified and debugged by @maxwxyz.

The Coin update included by FreeCAD commit 521f19d16d incorporated Coin commit 5e40f18505e8, which accidentally removed the macOS GLU header check:

check_include_file(OpenGL/glu.h HAVE_OPENGL_GLU_H)

Clean macOS configurations therefore left HAVE_OPENGL_GLU_H undefined.

With GLU_RUNTIME_LINKING and GLU_IS_PART_OF_GL enabled, this prevented GLUWrapper from opening the current process image and resolving GLU symbols from Apple’s OpenGL framework. Optimized Release builds reduced this path to available = 0, disabling GLU-dependent functionality without producing a build or linker error.

This ended up causing issues in the font loading backends, which need GLU for font rasterization.

Existing CI did not catch the regression because Coin still compiled successfully and no test verified that the GLU runtime loader was actually usable.

Solution

Restore the OpenGL/glu.h probe for native macOS builds:

if(APPLE AND NOT COIN_BUILD_MAC_X11)
  check_include_file(OpenGL/glu.h HAVE_OPENGL_GLU_H)
  check_include_file(OpenGL/CGLCurrent.h HAVE_OPENGL_CGLCURRENT_H)
endif()

Add a headless runtime test that verifies configurations where GLU is part of the linked OpenGL framework can:

  • initialize GLUWrapper;
  • report GLU as available;
  • resolve the GLU tessellator functions;
  • create and destroy a GLU tessellator.

The private-wrapper test runs on macOS and Linux. It is excluded on Windows because GLUWrapper is intentionally not exported from the Coin DLL.

@tritao tritao changed the title Restore macOS GLU header detection Restore macOS GLU detection and test runtime loading Sep 2, 2026
@tritao
tritao force-pushed the fix/restore-macos-glu-header-detection branch from 4aad247 to 984d97a Compare September 2, 2026 19:40
@tritao

tritao commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator Author

Tested by @maxwxyz

@tritao
tritao merged commit 5a4d285 into freecad-master Sep 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant