[rebase] split off gps and cava modules into run-time loaded shared libraries #4735
+524
−318
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.
rebase of #4667 , a (proposed) fix for #4276
justification for this PR is discussed in the issue, dynamically loading modules allows a waybar build with cava and gps capabilities to be packaged in a way that allows for libgps, libcava and epoxy to be optional dependencies.
Another goal of this PR was to include as few modifications to module code as necessary. For this reason I decided to split off the cava and gps modules into shared libraries, and to load them in factory.cpp using dlopen() / dlsym() .
The first 4 commits deal with the fact that reap_mtx / reap were previously an "extern" reference deep within include/util/command.hpp , which is included in every module and thus prevents the split up. Passing reap_mtx / reap to the module constructors rectifies this, but necessarily touches lots of constructors. I recommend looking at a word-diff of these commits.