ImHex icon indicating copy to clipboard operation
ImHex copied to clipboard

build: Allow specifying list of plugin dependencies for IDE launch schemes

Open mentlerd opened this issue 9 months ago • 6 comments

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 interrupting tweakTargetsForIDESupport.

Nothing prevents the code from working as a function, and thus it has been converted to one.

mentlerd avatar May 20 '24 12:05 mentlerd