Hello, I've written Meson build definitions for xclip.
This patch appears to depend on #123 on my system, without it a build error occurs due to the missing #include. That's not a build system issue so it's in its own PR.
I've kept the new build system mostly functionally the same as the autotools-based one, I'm not aware of any lost functionality. The differences are as follows:
The build is now done with Link Time Optimization by default.
Meson abstracts enabling compiler warnings, I've set them to the highest level which for GCC and Clang translates into "-Wall -Wextra -Wpedantic". This differs from the Autotools script which uses "-Wall" under GCC.
I've explicitly set the C standard to C99, the project didn't build with Clang/GCC set to C89 mode due to mixing declarations and code.
The test in "borked.c" was integrated into Meson's test support, "xctest" wasn't because I haven't figured out how to do it.
I think Meson is a better build system because it took me roughly 9 hours to translate the Autotools definitions into a meson.build and test the result, and this has already gained the project the following:
Out of source build support, requested in #111. Meson always uses a build directory, this directory can be outside the source.
pkg-config is used to find Xmu, iconv on the other hand is a complicated case and may be part of the libc or provided by something like GNU libiconv, I've only tested this patch on OpenBSD and it appears to find libiconv where Autotools can't.
Simplified build. Just type meson setup build and meson compile -C build and Meson sets itself up in the "build" directory and produces a debug binary at "build/xclip".
Test integration. This should make it easy for package maintainers to test xclip before updating it in their distro/OS, it should also make it easier for xclip developers to produce and run tests. So far only "borked.c" is integrated.
Ease of development. Meson notices when you change your compiler flags and triggers a rebuild, Meson also notices changes made to headers included by source files and triggers rebuilds of files that include the specific header.
Whichever Meson feature turns out to be useful. Meson supports cross compilation, many compilers, test coverage reports, it automagically figures out what to put in a dist file, it runs on Windows, it makes separating the source tree into folders easy and more.
All of this by depending on Python, Ninja and Meson at build time.
Hello, I've written Meson build definitions for xclip.
This patch appears to depend on #123 on my system, without it a build error occurs due to the missing #include. That's not a build system issue so it's in its own PR.
I've kept the new build system mostly functionally the same as the autotools-based one, I'm not aware of any lost functionality. The differences are as follows:
I think Meson is a better build system because it took me roughly 9 hours to translate the Autotools definitions into a meson.build and test the result, and this has already gained the project the following:
meson setup build
andmeson compile -C build
and Meson sets itself up in the "build" directory and produces a debug binary at "build/xclip".All of this by depending on Python, Ninja and Meson at build time.