]> granicus.if.org Git - libexpat/commitdiff
CMake: Catch troublesome build combinations for -DEXPAT_CHAR_TYPE=ushort
authorSebastian Pipping <sebastian@pipping.org>
Wed, 9 Oct 2019 21:10:28 +0000 (23:10 +0200)
committerSebastian Pipping <sebastian@pipping.org>
Sat, 12 Oct 2019 21:22:24 +0000 (23:22 +0200)
expat/CMakeLists.txt

index 4873e41bb05f17f27da91079705d5b244eff1525..72c3212cc83cff7d6b433514b94dd995e6280ca4 100644 (file)
@@ -111,6 +111,12 @@ if(EXPAT_CHAR_TYPE STREQUAL "char")
 elseif(EXPAT_CHAR_TYPE STREQUAL "ushort")
     set(_EXPAT_UNICODE ON)
     set(_EXPAT_UNICODE_WCHAR_T OFF)
+    if(EXPAT_BUILD_EXAMPLES)
+        message(SEND_ERROR "Examples can not be built with option -DEXPAT_CHAR_TYPE=ushort. Please pass -DEXPAT_CHAR_TYPE=(char|wchar_t) or -DEXPAT_BUILD_EXAMPLES=OFF.")
+    endif()
+    if(EXPAT_BUILD_TESTS)
+        message(SEND_ERROR "The testsuite can not be built with option -DEXPAT_CHAR_TYPE=ushort. Please pass -DEXPAT_CHAR_TYPE=(char|wchar_t) or -DEXPAT_BUILD_TESTS=OFF.")
+    endif()
     if(EXPAT_BUILD_TOOLS)
         message(SEND_ERROR "The xmlwf tool can not be built with option -DEXPAT_CHAR_TYPE=ushort. Please pass -DEXPAT_CHAR_TYPE=(char|wchar_t) or -DEXPAT_BUILD_TOOLS=OFF.")
     endif()