Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 3 commits into from

Conversation

mentlerd
Copy link
Contributor

@mentlerd mentlerd commented May 20, 2024

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.

@codecov-commenter
Copy link

codecov-commenter commented May 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 1.51%. Comparing base (bdaf1e4) to head (abde2f2).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1692   +/-   ##
======================================
  Coverage    1.51%   1.51%           
======================================
  Files         275     275           
  Lines       27008   27008           
  Branches    14474   14474           
======================================
  Hits          409     409           
  Misses      26341   26341           
  Partials      258     258           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@iTrooz
Copy link
Collaborator

iTrooz commented May 23, 2024

Why not use the target imhex_all instead of main ?

@mentlerd
Copy link
Contributor Author

Why not use the target imhex_all instead of main ?

That will generate the required libraries, but not launch the main executable. The goal is to be able to develop without having to change schemes in Xcode constantly.

@iTrooz
Copy link
Collaborator

iTrooz commented May 24, 2024

I'm confused. Doing ninja main in my terminal doesn't launch ImHex ?

@mentlerd
Copy link
Contributor Author

I'm confused. Doing ninja main in my terminal doesn't launch ImHex ?

It does in Xcode. That's why the entire thing is constrained in ide_helpers.cmake

@iTrooz
Copy link
Collaborator

iTrooz commented May 26, 2024

Isn't there a way to make ImHex run when compiling the imhex_all task ? This sounds like a XCode issue rather than ImHex

@mentlerd mentlerd closed this Aug 7, 2024
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.

3 participants