remove option to use ancient FriBiDi

This commit is contained in:
Nils Kneuper 2015-04-12 13:23:54 +02:00
parent c824388546
commit 05d6e7dd9b
5 changed files with 12 additions and 27 deletions

View file

@ -582,7 +582,7 @@ if(ENABLE_TESTS)
find_package( Boost 1.36 REQUIRED COMPONENTS unit_test_framework )
endif(ENABLE_TESTS)
if(ENABLE_GAME)
find_package( FriBiDi )
find_package( FriBiDi 0.10.9 )
if(ENABLE_FRIBIDI AND FRIBIDI_LIBRARIES)
add_definitions(-DHAVE_FRIBIDI)
elseif(ENABLE_FRIBIDI AND NOT FRIBIDI_LIBRARIES)

View file

@ -377,6 +377,10 @@ In previous versions of wesnoth, if a game is hosted in the mp server which requ
In current versions, all games carry metadata which documents which add-ons are needed to play them, and at what versions. UMC authors may specify for each [era] or [modification] what the minimum add-on version is with which this content is backwards compatible, by adding "addon_min_version" attributes to these tags, which should be verion strings e.g. "1.2.3" to be compared with the add-on version string in the .pbl file of the add-on. [b] If no minimum version is specified, it is assumed that there is no backwards compatibility! [/b] Wesnoth clients will take all this information into account, and when a user tries to join a game with UMC content, will request to automatically update the relevant add-ons if it will make it possible to play the game. Wesnoth clients will also warn the user when the host has out-of-date add-ons, a situation which cannot be resolved unless the host updates.
[/section]
[section="FriBiDi"]
Support for ancient versions of FriBiDi was dropped. The minimum for both CMake as well as scons is building with fribidi >= 0.10.9. Building with the latest versions might cause some warnings about depricated functions. If you encounter these, please build either with strict compilation turned off or without FriBiDi support.
[/section]
==========
KNOWN BUGS
==========

View file

@ -569,6 +569,7 @@ Version 1.13.0-dev:
* Remove support for legacy style unit abilities descriptions.
* Fixed bug #23445: set default build type in cmake to "Release" to ensure
that the game is not unoptimized
* Increased minimum version of FriBiDi to 0.10.9 in cmake to match scons
Version 1.11.11:
* Add-ons server:

View file

@ -9,8 +9,11 @@
# also defined, but not for general use are
# FRIBIDI_LIBRARY, where to find the FriBiDi library.
#
# If this module finds an old version of fribidi, then this module will run
# add_definitions(-DOLD_FRIBIDI) so that Wesnoth will compile.
# FriBiDi provides both fribidi_utf8_to_unicode and fribidi_charset_to_unicode.
# The difference is that
# 1. fribidi >= 0.10.5 has FRIBIDI_CHAR_SET_UTF8.
# 2. fribidi <= 0.10.4 has FRIBIDI_CHARSET_UTF8.
# Wesnoth uses fribidi_charset_to_unicode and FRIBIDI_CHAR_SET_UTF8.
include(CheckSymbolExists)
@ -33,19 +36,9 @@ FIND_LIBRARY(FRIBIDI_LIBRARY
IF (FRIBIDI_LIBRARY AND FRIBIDI_INCLUDE_DIR)
SET(CMAKE_REQUIRED_INCLUDES ${FRIBIDI_INCLUDE_DIR})
SET(CMAKE_REQUIRED_LIBRARIES ${FRIBIDI_LIBRARY})
CHECK_SYMBOL_EXISTS(fribidi_utf8_to_unicode fribidi.h FOUND_fribidi_utf8_to_unicode)
CHECK_SYMBOL_EXISTS(fribidi_charset_to_unicode fribidi.h FOUND_fribidi_charset_to_unicode)
CHECK_SYMBOL_EXISTS(FRIBIDI_CHAR_SET_UTF8 fribidi.h FOUND_FRIBIDI_CHAR_SET_UTF8)
# FriBiDi provides both fribidi_utf8_to_unicode and fribidi_charset_to_unicode.
# The difference is that
# 1. fribidi >= 0.10.5 has FRIBIDI_CHAR_SET_UTF8.
# 2. fribidi <= 0.10.4 has FRIBIDI_CHARSET_UTF8.
# Wesnoth has two methods to use FriBiDi.
# 1. Use fribidi_charset_to_unicode and FRIBIDI_CHAR_SET_UTF8.
# 2. Define OLD_FRIBIDI and use fribidi_utf8_to_unicode.
# To compile Wesnoth with fribidi <= 0.10.4, we must define OLD_FRIBIDI.
# Newer versions of fribidi (not tested the initial version which has the
# issue, but at least 0.19.2 has the issue) no longer have the symbol
# FRIBIDI_CHAR_SET_UTF8. But the symbol is build with some macros confusing
@ -68,12 +61,6 @@ IF (FRIBIDI_LIBRARY AND FRIBIDI_INCLUDE_DIR)
# fribidi >= 0.10.5
SET(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY})
SET(FRIBIDI_FOUND "YES")
elseif(FOUND_fribidi_utf8_to_unicode)
# fribidi <= 0.10.4
SET(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY})
SET(FRIBIDI_FOUND "YES")
add_definitions(-DOLD_FRIBIDI)
MESSAGE(STATUS "Legacy FriBiDi: ${FRIBIDI_LIBRARY}")
else()
SET(FRIBIDI_LIBRARIES "NOTFOUND")
SET(FRIBIDI_INCLUDE_DIR "NOTFOUND")

View file

@ -627,17 +627,10 @@ void text_surface::bidi_cvt()
FriBidiStrIndex n;
#ifdef OLD_FRIBIDI
n = fribidi_utf8_to_unicode (c_str, len, bidi_logical);
#else
n = fribidi_charset_to_unicode(FRIBIDI_CHAR_SET_UTF8, c_str, len, bidi_logical);
#endif
fribidi_log2vis(bidi_logical, n, &base_dir, bidi_visual, NULL, NULL, NULL);
#ifdef OLD_FRIBIDI
fribidi_unicode_to_utf8 (bidi_visual, n, utf8str);
#else
fribidi_unicode_to_charset(FRIBIDI_CHAR_SET_UTF8, bidi_visual, n, utf8str);
#endif
is_rtl_ = base_dir == FRIBIDI_TYPE_RTL;
str_ = std::string(utf8str);
delete[] bidi_logical;