freetype-devel
[Top][All Lists]
Advanced

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

Re: [Freetype-devel] Re: Build system considerations


From: David Turner
Subject: Re: [Freetype-devel] Re: Build system considerations
Date: Fri, 1 May 2020 01:00:44 +0200



Le jeu. 30 avr. 2020 à 10:40, Nikolaus Waxweiler <address@hidden> a écrit :
One thing regarding build systems and IDE/tool integration:

Cmake and others can generate a
https://clang.llvm.org/docs/JSONCompilationDatawas a portabililty nightmarebase.html that help
tools like static analyzers and language servers and IDEs parse
projects. It's very nice have when you hack on something.

It also means that you have to have an entry for every single .c file,
unless I'm missing something. FreeType bundles several .c files into
bigger .c files, breaking the database. Werner mentioned that this is
done because older compilers have worse inlining or dead code
elimination or something like that. It would still be nice to have the
database.

The wrapper source files are used for two reasons:

1) Speed up compilation (though this is less of an issue with today's powerful CPUs and multiple cores)

2) Much better / smaller generated machine code, because all FT_LOCAL functions are really "static" and can be freely inlined by the simplest compiler.
Getting the same level of optimization without wrappers requires link-time-optimization (LTO), which may or may not be available depending on the toolchain you're using, and cannot always be enabled by projects embedding the library for multiple reasons (LTO is super slow, ThinLTO makes it slightly better, but only if you use Clang, etc).

Apart from that, it would be easy to write a script to generate the proper compilation database from the rules.mk/module.mk file with the patches I've submitted to the mailing list (in another thread).
Also other tools can output such a database (e.g. GN has --export-compile-commands=default for example, not sure about Meson).

Something to consider when cleaning up the build system :)

2020-04-30 9:11 GMT+01:00, suzuki toshiya <address@hidden>:
> The circular dependency is a headache, but I don't think the
> reconsideration of the building system is good place to discuss
> the simplification of the dependency between FreeType and harfbuzz.
>
> In my understanding, the features of harfbuzz used by FreeType are
> very small subset, the classification of character encoding, script
> and language. Although I sympathize with the circular dependency
> problem, it would not be good idea to cloning them into FreeType
> source code, because of the different time-frames between FreeType
> and Unicode related features of harfbuzz (or Unicode itself).
>
> Some meta-building system would be the easiest way to avoid the
> manual and repeated building of FreeType and harfbuzz, aslike some
> GNU toolchains (binutils + gcc + gdb) ?
>
> Regards,
> mpsuzuki
>
> P.S.
> But, I'm interested in the decision under a situation: if harfbuzz
> requires libstdc++, should we care the dependency of FreeType?
>
>
> Vincent Torri wrote:
>> On Thu, Apr 30, 2020 at 8:39 AM Werner LEMBERG <address@hidden> wrote:
>>>
>>>> currently, to have harfbuzz support, freetype must be compiled
>>>> without hb support, then build hb with freetype support, then
>>>> freetype with hb.
>>>>
>>>> it would be nice to remove this circular dependency
>>> AFAIK, this would only be possible by splitting either HarfBuzz or
>>> FreeType into two packages, and this won't happen.
>>
>> or moving/coying some functions from freetype to hb, or conversely  ?
>>
>> Vincent Torri
>>
>>
>
>


reply via email to

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