Skip to content

Replace Autotools with Meson#186

Open
andy128k wants to merge 4 commits into
mvo5:masterfrom
andy128k:meson
Open

Replace Autotools with Meson#186
andy128k wants to merge 4 commits into
mvo5:masterfrom
andy128k:meson

Conversation

@andy128k

Copy link
Copy Markdown
Contributor

No description provided.

@andy128k andy128k force-pushed the meson branch 7 times, most recently from 39b21b6 to ea0e581 Compare June 22, 2026 19:27
@amaa-99

amaa-99 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Hi. First of all, great work!

I had some thoughts about that too...

When replacing the Autotools with something else, wouldn't it make sense to go for something like CMake, which is widely supported by most IDEs?

Being able to easily import the project into any preferred IDE would definitely be a big plus.

Please note that CMake has integrations for Ninja and ccache too, so the build performance would be optimal too (though the synaptic project is relatively small, thus the build time is not so critical (though faster is always nice)).

@andy128k

andy128k commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

My take is: CMake is more C/C++ centric while Meson is general purpose and is widely used in Gtk/Gnome applications.

@andy128k andy128k force-pushed the meson branch 2 times, most recently from edd66a9 to 4c46edb Compare July 1, 2026 07:30
@amaa-99

amaa-99 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Hi. I'm trying out your branch. Here's my findings so far:

Eclipse

Opening the project on eclipse (with the respective plugin installed) resulted in an inconsistent state (i.e. the IDE didn't detect the configuration correctly).

  • The include paths were not detected/configured correctly (I couldn't find a workaround).
  • Therefore the indexing and code analysis features didn't work correctly (i.e. no code completion, references tracking...).

Qt Creator

Opening and building the project on Qt Creator worked after adding the following to the executable() definitions:

implicit_include_directories: true,   # Add the build folders to the include paths so that the generated headers can be found.

However Qt creator doesn't show any of the project's header files in the project view!
That seems to be a known limitation (https://doc.qt.io/qtcreator/creator-project-meson.html):

Current Meson support limitations
The following features are not supported yet:

    Showing header files in project tree.
    Configuration change detection, for example when building triggers a Meson configuration first.
    Actions from locator such as searching or triggering builds.
    Adding files to Meson projects from Qt Creator.

General building

Building failed on my environment trying to localize the com.ubuntu.pkexec.synaptic.policy file, due to the /usr/share/gettext/its/polkit.its and polkit.loc files not being installed on the system.

To fix that I've installed the libpolkit-gobject-1-dev package and added the following to the root meson.build file (so that there's a clear error in case the dependency is missing):

# The libpolkit-gobject-1-dev package provides the /usr/share/gettext/its/polkit.its and polkit.loc files
# used by the execution of the i18n.merge_file('com.ubuntu.pkexec.synaptic.policy') command.
libpolkit_dep = dependency('polkit-gobject-1', required: true)

@andy128k

andy128k commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@amaa-99 Thanks for testing this! I use Gnome Builder and it works w/o any issues. I've just tried to build and run tests in VS Code and it has no issues either.

implicit_include_directories is true by default and should not be needed.

polkit-gobject-1 is really needed. I added it to github action but totally forgot to add to meson.build.

Side note: if you haven't had it on your system, then how did autotools work for you? (or how does it work on github actions?) 😄

@amaa-99

amaa-99 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

I've tried VS Code too, and it seems to be the only IDE so far that was able to interpret the meson project decently enough.
Code analysis works, and so does the code completion, reference tracking and so on...
I still need to try doing a debugging session...

The Gnome Builder is also one of the few that handles the autotools nicely.
Unfortunately as a generic IDE it is (for me) not a practical option (I guess it is intended to be a specialized builder as the name implies).

About the implicit_include_directories, I guess the parsers on the project import plugins of the IDEs don't take the default values into account. On Eclipse not even that did the job.

@andy128k andy128k force-pushed the meson branch 3 times, most recently from 3296d42 to 656ff29 Compare July 5, 2026 23:37
@andy128k andy128k marked this pull request as ready for review July 5, 2026 23:43
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.

2 participants