The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Roboron on May 06, 2024, 06:42:23 PM

Title: Make Freetype required (for non-server builds)
Post by: Roboron on May 06, 2024, 06:42:23 PM
Simutrans 124.0 implicitly made Freetype a required dependency, but this change was not reflected on the build system. As a consequence, some users (@Flemmbrav) have been building without Freetype, only to find that the game does not start as it can't load any fonts.

This patch removes the USE_FREETYPE compile flag and related options. When necessary, the compile flag has been replaced by COLOUR_DEPTH != 0, so that server builds can be compiled without freetype.

The behavior now for CMake is that if Freetype is not found then it fallback to a server build (sames as if SDL2 is not found). You can discuss if this is the desired behavior or if we should make Freetype/SDL2 mandatory if no backend has been defined.

For other build systems, I have not looked much into the autoconfiguration. You may want to complete this patch with whatever is necessary.
Title: Re: Make Freetype required (for non-server builds)
Post by: prissi on May 07, 2024, 05:52:33 AM
The server builds should not use freetype. But indeed, otherwise it has become mandatory. I am fine with that.

EDIT: I added it to autoconf and submitted it.

EDIT2: breaks the Android built (which is cmake)

Edit3: SDL include cannot be found on Android?!?
Title: Re: Make Freetype required (for non-server builds)
Post by: Roboron on May 07, 2024, 05:43:35 PM
It was because Freetype was not being search for in the Android build, therefore Freetype_FOUND was not set.

I have moved those checks to SimutransBackend.cmake (indeed, they make more sense there), and the Android build works again.
Title: Re: Make Freetype required (for non-server builds)
Post by: prissi on May 08, 2024, 12:34:32 PM
Thank you, success confirmed