C/C++ code is not ready to get those from expat_config.h, yet.
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)
_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()
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
/* 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__