summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Rast <frank.rast@gefeg.com>2018-08-09 09:33:48 +0200
committerFrank Rast <frank.rast@gefeg.com>2018-08-09 09:33:48 +0200
commit1a1d1841c0d37143f8077c85a432d932aa96082b (patch)
tree40b62e1ddb194b1cae804d149642804e27658dad
parent53d8e002757f170b0daa582d201f5da90dde9966 (diff)
downloadlibexpat-git-1a1d1841c0d37143f8077c85a432d932aa96082b.tar.gz
CMake: Add options XML_UNICODE and XML_UNICODE_WCHAR_T
-rw-r--r--expat/CMakeLists.txt13
-rw-r--r--expat/expat_config.h.cmake6
2 files changed, 19 insertions, 0 deletions
diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt
index 9e1de250..12480eae 100644
--- a/expat/CMakeLists.txt
+++ b/expat/CMakeLists.txt
@@ -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()
diff --git a/expat/expat_config.h.cmake b/expat/expat_config.h.cmake
index d2dcd801..3e23f487 100644
--- a/expat/expat_config.h.cmake
+++ b/expat/expat_config.h.cmake
@@ -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__