build: Allow specifying list of plugin dependencies for IDE launch schemes #1692
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.
Problem description
Launching ImHex from Xcode is clunky, as the
main
target does not depend on plugins. Therefore editing a source file, and simply launching the active Xcode scheme may result in the application using a previously built version of the file just edited.From a build system perspective this is perfectly logical. The main executable can be built independently of any plugins, but this is very annoying UX.
Implementation description
This PR adds a new cmake boolean option
IMHEX_IDE_HELPERS_MAIN_DEPENDS_ON_PLUGINS
which does as the name imply.Plugins in the build will be marked as a dependency of the
main
target, allowing a single-button launch from the IDE without having to think twice about which plugin was just edited.Screenshots
N/A
Additional things
_tweakTargetsRecursive
was mistakenly declared as a macro. This caused issues due to an early return in the implementation prematurely interruptingtweakTargetsForIDESupport
.Nothing prevents the code from working as a function, and thus it has been converted to one.