freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: about the meson build systel


From: David Turner
Subject: Re: about the meson build systel
Date: Tue, 25 Aug 2020 00:14:20 +0200

Actually, the size problem was that otvalid/gxvalid were always compiled into the library.
I've improved meson.build to parse modules.cfg to get the list of all main and auxiliary modules, to replicate what the Make-based build does.

Now the default build is 712 KiB for all build systems on my machine (Linux x64 Kubuntu 19.10)

(NOTE: I'm really not a fan of modules.cfg and hope to get rid of it in the future, but for now, it's better to keep things this way for consistency).

I also got rid of the builds/meson/ directory entirely. The unmodified ftconfig.h is now used, with HAVE_UNISTD_H and HAVE_FCNTL_H added as compile-time macros instead.


Le lun. 24 août 2020 à 23:27, David Turner <david@freetype.org> a écrit :


Le lun. 24 août 2020 à 22:34, Werner LEMBERG <wl@gnu.org> a écrit :

Hello David,


> - builds/meson/ftconfig.h.in: template versions of
>   ftconfig.h to be used by the Meson build. It is processed
>   by Meson, which will turn #mesondefine statements into
>   #define / #undef depending on build configuration.

having a meson-specific `ftconfig.h.in` file is not ideal.  I think we
should avoid that.
 
Please change that.  A simple solution could be to always create
`ftconfig.h` from a template even for a `make devel` or an autoconf
build.

I was just trying to reproduce what we're currently doing with builds/unix/ftconfig.h.in. I agree this is far from ideal though.

I propose to get rid of this template entirely for Meson, by defining HAVE_UNISTD_H and HAVE_FCNTL_H
as simple compiler arguments when building the library. There is really little reason for these to appear in ftconfig.h anyway.

For the builds/unix/ftconfig.h.in case, there is also FT_USE_AUTOCONF_SIZEOF_TYPES, whose utility currently escapes me
(i.e. FreeType's auto-detection of SIZEOF_INT and SIZEOF_LONG should be largely sufficient, at least for any C89 compiler).
I didn't want to touch that, but we should consider removing these entirely, unless there is a practical benefit to it
(since I suspect it is here for historical reasons). Any opinion on this? I'd be nice to get rid of this template as well.
 
Will check the rest of your code soon.

> Library size comparison for stripped libfreetype.so generated
> by all three build systems:
>
>   - Default build (autotools + libtool): 712 KiB
>   - CMake build (RelWithDebInfo):        712 KiB
>   - Meson build:                         784 KiB

Can this be improved for meson?

I think it's possible. I've been looking at it. The compiled objects are exactly the same, but the Meson build will link /usr/lib/x86_64-linux-gnu/libbz2.a /usr/lib/x86_64-linux-gnu/libbz2.so.1.0.4 (both of them), while the CMake build will only use the shared library version!
And my libbz2.a is about 80 KiB which fits the difference. Looks like we're statically linked libz2.a by mistake here. Let me try to fix it.


    Werner

Attachment: 0001-build-Add-Meson-build-project-files.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]