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

Add a meson build system #225

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Add a meson build system #225

wants to merge 2 commits into from

Conversation

dcbaker
Copy link

@dcbaker dcbaker commented May 7, 2020

meson is a build system generator similar to cmake or autotools, but
without the craziness of either of those languages. It provides a pleasant
scripting language that is inspired by languages like python, but is not
python. It has a non-turring complete language, with an emphasis on
upstream functionality instead of downstream scripts. It has support for
most Unix-like OSes, including Linux, the four major BSDs, and macOS.
this includes support for abstracting dependency discovery, using
pkg-config, macOS frameworks, cmake, and some hand coded finders for
very common packages. It provides nice features like builtin support for debug builds,
changing from static to shared library builds, turning warning arguments
on and off, generates for pkg-config, and other modern niceties.

For g810-led this provides a number of advantages for distro packaging.
Distros already use meson for projects like mesa, systemd, and gnome, so
they're packaging wrappers already know how to configure, build, and
install meson based packages. It also provides advantages when moving to
other platforms, as meson understands the difference between clang,
apple's clang fork, gcc, and a host of other compilers.

I'll understand if you're not interested, I mostly wrote this for my own use (
the make system included doesn't work on my distro without passing a host
of linker flags due to where libraries are placed, but would work fine if
pkg-config was used). I thought I'd offer, since there's also work on using this
with macos, and meson would hopefully simplify that as well.

One major difference between the meson build and the markefile build is that
the meson build doesn't attempt to link a default profile, or run systemd commands
on install/uninstall. That really isn't something that the build system should be
doing, that's something the distro package manager should be doing for you.

I've additionally added a pkg-config file for the library, to make linking against
it simpler, especially when libhidapi is used, and an additional -D option needs
to be passed to the compiler.

dcbaker added 2 commits May 7, 2020 15:53
meson is a build system generator similar to cmake or autotools, but
without the crazy of either of those languages. It provides a pleasant
scripting language that is inspired by languages like python, but is not
python. It has a non-turing complete language, with an emphasis on
upstream functionality instead of downstream scripts. It has support for
most Unix-like OSes, including linux, the four major BSDs, and macOS.
this includes support for abstracting dependency discovery, using
pkg-config, macOS frameworks, cmake, and some hand coded extensions.

It provides nice features like builtin support for debug builds,
changing from static to shared library builds, turning warning arguments
on and off, generates for pkg-config, and other modern niceties.

For g810-led this provides a number of advantages for distro packaging.
Distros already use meson for projects like mesa, systemd, and gnome, so
they're packaging wrappers already know how to configure, build, and
install meson based packages. It also provides advantages when moving to
other platforms, as meson understands the difference between clang,
apple's clang fork, gcc, and a host of other compilers.
This makes it much easier to link against libg810-led than manually
specifying compiler options, especially since in some cases you need to
pass extra cppflags.
@MatMoul
Copy link
Owner

MatMoul commented May 8, 2020

Thank for the PR...
I just discover meson.
Maintaining multiple build systems makes things more complicated.
But I like this solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants