CMake: Add options XML_UNICODE and XML_UNICODE_WCHAR_T

This commit is contained in:
Frank Rast 2018-08-09 09:33:48 +02:00
parent 53d8e00275
commit 1a1d1841c0
2 changed files with 19 additions and 0 deletions

View File

@ -58,6 +58,8 @@ if(NOT WIN32)
set(XML_DEV_URANDOM 0)
endif(XML_DEV_URANDOM)
endif()
option(XML_UNICODE "Use UTF-16 encoded chars (two bytes) instead of UTF-8" OFF)
option(XML_UNICODE_WCHAR_T "Use wchar_t to represent UTF-16 instead of unsigned short" OFF)
if(XML_DTD)
set(XML_DTD 1)
@ -69,6 +71,17 @@ if(XML_NS)
else(XML_NS)
set(XML_NS 0)
endif(XML_NS)
if(XML_UNICODE)
set(XML_UNICODE 1)
else(XML_UNICODE)
set(XML_UNICODE 0)
endif(XML_UNICODE)
if(XML_UNICODE_WCHAR_T)
set(XML_UNICODE_WCHAR_T 1)
else(XML_UNICODE_WCHAR_T)
set(XML_UNICODE_WCHAR_T 0)
endif(XML_UNICODE_WCHAR_T)
if(BUILD_tests)
enable_testing()

View File

@ -99,6 +99,12 @@
#cmakedefine XML_DEV_URANDOM
#endif
/* Define to use UTF-16 chars (two bytes). */
#cmakedefine XML_UNICODE
/* Define to use wchar_t as UTF-16 char type instead of unsigned short. */
#cmakedefine XML_UNICODE_WCHAR_T
/* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */
#ifdef _MSC_VER
# define __func__ __FUNCTION__