editorconfig / editorconfig

EditorConfig universal issue tracker and wiki
http://editorconfig.org
3.11k stars 103 forks source link

Libeditorconfig meson support #480

Open Zacharymk1213 opened 1 year ago

Zacharymk1213 commented 1 year ago

While trying to cross-compile Gnome Text Editor for Windows I noticed a lack of support for Meson in libeditorconfig which is a dependency of Gnome Text Editor. Discussed in detail here: https://gitlab.gnome.org/GNOME/gnome-text-editor/-/issues/457#note_1544361

cxw42 commented 1 year ago

Could you give a bit more detail of what you're asking for? Meson support in editorconfig-core-c?

I see the gnome issue mentions being able to build with MSVC. The C core should already support that via cmake. Could you run cmake as part of your Meson build process?

Zacharymk1213 commented 1 year ago

I suppose I could run cmake as part of the build process. Do you have some documentation on how I could do so, for reference?

cxw42 commented 1 year ago

Ask and ye shall receive :)

Hope one of those helps!

eli-schwartz commented 1 year ago

I see the gnome issue mentions being able to build with MSVC. The C core should already support that via cmake. Could you run cmake as part of your Meson build process?

https://mesonbuild.com/Wrap-dependency-system-manual.html#provide-section

As is not entirely uncommon with build systems, if you have two projects that use the same build system it's often possible to include one inside the other and have it build as part of a mega-build. Meson does, indeed, support vendored subprojects (and has a nifty feature with a standard interface for selecting whether to use system or vendored copies of a dependency).

This request, then, is about adding a meson.build file for editorconfig-core-c which is at least sufficient to build and embed the library, such that it can be included as a drop-in inside other Meson projects that:

It's especially handy if you're building a standalone Windows package, don't typically have system dependencies available like Linux does, and don't want to faff around with building two things in a row in the right order. :D Or even a lot more than just two...

(pcre2 is already plugged into Meson in this fashion. Meson has limited support for configuring a cmake subproject, running the cmake trace API, and extracting the rules into Meson -- but passing a Meson subproject into a cmake subproject does not work, so editorconfig-core-c does need to be built via native Meson in order to perform well as a subproject for gnome-text-editor. It would probably work, if only editorconfig-core-c did not have any dependencies.)