Skip to content

Conversation

@JrFernando
Copy link
Contributor

Closes #13.

Screen.record.from.2025-11-09.21.30.57-2.webm

Implementation Notes

Why is add_project_arguments in the main meson.build?

While the DESKTOP_INTEGRATION flag is conceptually specific to the AppsPlugin, it must be declared in the main meson.build file due to a Meson build system requirement. Meson Requirement: add_project_arguments() must be called before any build targets are declared (before any executable(), shared_library(), etc.). This is a strict rule enforced by Meson to ensure all compiler arguments are available before compilation begins.

Build Order in this Project:

  1. subdir('lib') - declares the main library target
  2. subdir('plugins') - processes plugin subdirectories

By the time Meson reaches plugins/AppsPlugin/meson.build, the library target has already been declared in lib/, so calling add_project_arguments() there would fail with:

ERROR: Tried to use 'add_project_arguments' after a build target has been declared.

Why This Approach is Correct:

  • The option is properly defined in meson_options.txt as a project-level option
  • The plugins/AppsPlugin/meson.build still controls whether DesktopIntegration.vala is compiled
  • The DESKTOP_INTEGRATION flag is only used within #if DESKTOP_INTEGRATION blocks in the AppsPlugin code
  • This is a common pattern in Meson projects that need conditional compilation flags

Copy link
Owner

@leolost2605 leolost2605 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi thank you!
Only a minor thing: I think we should keep it disabled by default though or disable it in the flatpak manifest since appcenter pulls that in directly and I'll probably forget to branch and disable it on release 😬
We could add a separate manifest though which enables the option but I'd leave that to another PR 🤷

@JrFernando
Copy link
Contributor Author

@leolost2605 I disabled the option. Thank you.

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.

does not build with desktopintegration enabled

2 participants