[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] FT_USE_MODULE proper usage?
From: |
Werner LEMBERG |
Subject: |
Re: [ft-devel] FT_USE_MODULE proper usage? |
Date: |
Mon, 26 Mar 2012 08:18:44 +0200 (CEST) |
> I want to provide a simple header that users of the amalgamated
> version of FreeType can edit to turn modules on and off. For
> example, my own application doesn't require anything other than
> TrueType font loading, outline extraction, and hinting (no renderers
> or other formats needed).
>
> I'm looking at ftmodule.h and quite frankly, I'm stumped as to how
> it works. Is there any explanation lying around? Is it possible to
> not link in certain segments of FreeType?
As described in docs/INSTALL.ANY and docs/CUSTOMIZE, the normal
procedure for a flat build is
. copy the needed source files (base files, extensions, and modules)
. copy the `include' directory hierarchy
. adjust ftmodule.h so that at run time only the compiled-in modules
are registered
Your amalgamation stuff is essentially a flat build, but it includes
all source files. FreeType is not prepared to support this case;
there are no preprocessor macros to control which is really compiled
because the assumption is that unwanted stuff isn't present and thus
not compiled at all.
I don't know how to solve this easily. Perhaps your amalgamation tool
should add
#ifdef __FOO_C__
... contents of file `foo.c'
#endif
to all files, and a special header file (based on `modules.cfg' and
ftmodule.h) can then control the parts which are really compiled.
Note that I don't want to have such FOO_C macros in FreeType itself.
Werner