diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index 64e6e36b..16240e2a 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -113,6 +113,14 @@ if(EXPAT_BUILD_TOOLS AND (EXPAT_UNICODE AND NOT EXPAT_UNICODE_WCHAR_T)) message(SEND_ERROR "The xmlwf tool can not be built with option EXPAT_UNICODE_WCHAR_T=OFF and EXPAT_UNICODE=ON. Either set EXPAT_UNICODE_WCHAR_T=ON or EXPAT_BUILD_TOOLS=OFF.") endif() +if(EXPAT_UNICODE) + if(EXPAT_UNICODE_WCHAR_T) + add_definitions(-DXML_UNICODE_WCHAR_T) # for wchar_t + else() + add_definitions(-DXML_UNICODE) # for unsigned short + endif() +endif() + include(${CMAKE_CURRENT_LIST_DIR}/ConfigureChecks.cmake) macro(evaluate_detection_results use_ref have_ref thing_lower thing_title) @@ -135,8 +143,6 @@ _expat_copy_bool_int(EXPAT_DTD XML_DTD) _expat_copy_bool_int(EXPAT_LARGE_SIZE XML_LARGE_SIZE) _expat_copy_bool_int(EXPAT_MIN_SIZE XML_MIN_SIZE) _expat_copy_bool_int(EXPAT_NS XML_NS) -_expat_copy_bool_int(EXPAT_UNICODE XML_UNICODE) -_expat_copy_bool_int(EXPAT_UNICODE_WCHAR_T XML_UNICODE_WCHAR_T) if(NOT WIN32) _expat_copy_bool_int(EXPAT_DEV_URANDOM XML_DEV_URANDOM) endif() diff --git a/expat/Changes b/expat/Changes index c29d69fb..84a528a8 100644 --- a/expat/Changes +++ b/expat/Changes @@ -56,6 +56,8 @@ Release x.x.x xxx xxx xx xxxx CMake: Now produces a summary of applied configuration CMake: Require C++ compiler only when tests are enabled #265 CMake: Fix linking with MinGW + #330 CMake: Fix compilation for 16bit character types, + i.e. ex -DXML_UNICODE=ON (and ex -DXML_UNICODE_WCHAR_T=ON) #330 CMake: Add full support for MinGW; to enable, use -DCMAKE_TOOLCHAIN_FILE=[expat]/cmake/mingw-toolchain.cmake #330 CMake: Port "make run-xmltest" from GNU Autotools to CMake diff --git a/expat/expat_config.h.cmake b/expat/expat_config.h.cmake index bb8c86cd..173fed16 100644 --- a/expat/expat_config.h.cmake +++ b/expat/expat_config.h.cmake @@ -103,12 +103,6 @@ /* Define to make XML Namespaces functionality available. */ #cmakedefine XML_NS -/* 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__