]> granicus.if.org Git - libexpat/commitdiff
CMake: Add missing -municode for wchar_t MinGW
authorSebastian Pipping <sebastian@pipping.org>
Mon, 2 Sep 2019 22:10:57 +0000 (00:10 +0200)
committerSebastian Pipping <sebastian@pipping.org>
Mon, 2 Sep 2019 23:43:36 +0000 (01:43 +0200)
expat/CMakeLists.txt

index 16240e2a024ecf24d5559904bd5e95c07b583f55..734339745123a5c1303140433036e862606d7b9f 100644 (file)
@@ -302,6 +302,12 @@ if(EXPAT_BUILD_TOOLS)
     set_property(TARGET xmlwf PROPERTY RUNTIME_OUTPUT_DIRECTORY xmlwf)
     target_link_libraries(xmlwf expat)
     expat_install(TARGETS xmlwf DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+    if(MINGW AND EXPAT_UNICODE_WCHAR_T)
+        # https://gcc.gnu.org/onlinedocs/gcc/x86-Windows-Options.html
+        set_target_properties(xmlwf PROPERTIES LINK_FLAGS -municode)
+    endif()
+
     if(EXPAT_BUILD_DOCS)
         file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc)
         add_custom_command(TARGET expat PRE_BUILD COMMAND "${DOCBOOK_TO_MAN}" "${PROJECT_SOURCE_DIR}/doc/xmlwf.xml" && mv "XMLWF.1" "${PROJECT_BINARY_DIR}/doc/xmlwf.1")