[Pixman] [PATCH] Add CMake build rules

whitequark whitequark at whitequark.org
Sun May 22 01:54:36 UTC 2016


CMake is a popular build system for C/C++ projects. One key property
it has is that a library using CMake can be "drop in" vendored,
that is, placed in the build tree of another project using CMake
and immediately used as if it was a part of that project.

There is no intermediate configuration step or build directories,
and it is enough to set up a (perhaps cross-)toolchain once for
the toplevel project. This results in a massive usability improvement
for the case where a project links many static libraries, such as
when deploying to Windows or Android, and especially when there is
a combinatorial explosion of targets and target options, such as
on Android, where it is necessary to produce x86, ARM and MIPS builds
in order to target the majority of devices.

For this reason, many projects (including, for example, zlib and
Freetype) opt to provide CMake build rules alongside autoconf ones.

These build rules closely follow the existing autoconf-based rules,
to the degree that any change in autoconf files should trivially
translate to changes in CMakeLists.txt, reducing maintainer workload.
In particular, it uses the same code to test for target-specific
compiler features.

There is no SunOS support, because SunOS is responsible for most
corner cases in the autoconf build rules and it is unlikely that
anyone is interested in using CMake for SunOS builds.

The CMake build rules were tested on:
   * x86_64-linux-gnu;
   * arm-linux-gnueabi;
   * mips-linux-gnu;
   * powerpc-linux-gnu.
On all targets, the target features were manually verified to pass
when they ought to, and the target-specific implementations were
manually verified to be linked in.

On x86_64-linux-gnu, all tests were verified to pass.
On other targets, all tests were verified to link correctly.

[actual patch included as attachment]

-- 
whitequark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-CMake-build-rules.patch
Type: text/x-diff
Size: 23833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pixman/attachments/20160522/94ba8b5f/attachment-0001.patch>


More information about the Pixman mailing list