Repository navigation
ofUtils: don't link the renderer / ofImage / app into tools that only use ofUtils (Linux depends) - #8605
Open
danoli3 wants to merge 1 commit into
Open
ofUtils: don't link the renderer / ofImage / app into tools that only use ofUtils (Linux depends)#8605danoli3 wants to merge 1 commit into
danoli3 wants to merge 1 commit into
Conversation
…that only use ofUtils (ofSaveScreen etc to ofGraphics.cpp, ofSetTimeMode* to ofAppRunner.cpp, event token / function id inline)
Member
Author
|
This should help unbind un-needed binary links and connections when not needed. Shall reduce final binary size if no functions used. |
danoli3
force-pushed
the
core-deps-ofutils
branch
from
October 26, 2026 08:07
0aabc48 to
08ae104
Compare
Member
Author
All-examples build: no regressionsEvery desktop example (157: everything except
The CI side was a temporary workflow (run). It built each tree, then a compare job failed only on examples that build on the base but not with the PR. It's been removed again, so the PR is back to its single commit. The two Linux failures are already on master and unrelated to this PR:
Issues and fixes for both are coming separately. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linking only
ofUtils(e.g.ofGetElapsedTimef, string / file helpers) fromlibopenFrameworks.apulled in most of the core, and on Linux every system library behind it. A static library links whole object files:ofUtils.o:ofSaveScreen/ofSaveViewport/ofSaveFrame->ofGetGLRenderer()+ofSaveImage()-> GL renderer, fonts, FreeImage (-> OpenEXR)ofUtils.o:ofSetTimeMode*/ofGetTimeMode->ofGetMainLoop()->ofAppGLFWWindow-> GLFW, X11, GLofUtils.o->ofEvents.o(only for the clock listener'sAbstractEventToken/StdFunctionIdout-of-line dtors andnextId) ->ofEvents()->ofAppRunner.o-> sound (OpenAL, libsndfile, mpg123), GStreamer, curlThat's why the Linux projectGenerator binary needs ~20 desktop libraries it never uses, and fails to start on distros with newer ones, e.g. Arch:
libOpenEXR-3_3.so.32: cannot open shared object file(openframeworks/projectGenerator#639, #8472). The existingFIXMEat the top of ofUtils.cpp asks for this split.Moved, no API change (declarations stay in ofUtils.h):
ofSaveScreen/ofSaveViewport/ofSaveFrame->ofGraphics.cppofGetTimeMode/ofSetTimeModeSystem/ofSetTimeModeFixedRate/ofSetTimeModeFiltered->ofAppRunner.cpp(they call the clock through twoof::privsetters left in ofUtils.cpp)AbstractEventToken,BaseFunctionId,StdFunctionIddtors= defaultandStdFunctionId::nextIdinline staticinofEvent.hprojectGenerator commandLine on Linux (Ubuntu 24.04 arm64, current master,
readelf -dNEEDED):ofLog.o,ofFileUtils.o,ofUtils.olinked from the core)Tested: core builds on Linux (make) and macOS (Xcode); a generated linux64 app with ofxGui builds and links; projectGenerator runs and generates linux64 / vs projects.