From 102179f8793f90e5a24a30c5e7364008d5865ec8 Mon Sep 17 00:00:00 2001 From: klaus triendl Date: Thu, 16 Jan 2020 23:33:22 +0200 Subject: [PATCH] [libxml2] Embed resources in Windows-based shared library (#9474) (#9492) --- ports/libxml2/CMakeLists.txt | 2 ++ ports/libxml2/RemoveIncludeFromWindowsRcFile.patch | 10 ++++++++++ ports/libxml2/portfile.cmake | 2 ++ 3 files changed, 14 insertions(+) create mode 100644 ports/libxml2/RemoveIncludeFromWindowsRcFile.patch diff --git a/ports/libxml2/CMakeLists.txt b/ports/libxml2/CMakeLists.txt index 12142f4ff9..69fc246f9a 100644 --- a/ports/libxml2/CMakeLists.txt +++ b/ports/libxml2/CMakeLists.txt @@ -123,6 +123,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsSt -DHAVE_WIN32_THREADS _WINSOCK_DEPRECATED_NO_WARNINGS ) + target_sources(libxml2 PRIVATE win32/libxml2.rc) + set_source_files_properties(win32/libxml2.rc PROPERTIES COMPILE_FLAGS "-DLIBXML_MAJOR_VERSION=${LIBXML_MAJOR_VERSION} -DLIBXML_MINOR_VERSION=${LIBXML_MINOR_VERSION} -DLIBXML_MICRO_VERSION=${LIBXML_MICRO_VERSION} -DLIBXML_DOTTED_VERSION=\\\"${VERSION}\\\"") endif() target_compile_definitions(libxml2 PRIVATE diff --git a/ports/libxml2/RemoveIncludeFromWindowsRcFile.patch b/ports/libxml2/RemoveIncludeFromWindowsRcFile.patch new file mode 100644 index 0000000000..ce5a3fcbe0 --- /dev/null +++ b/ports/libxml2/RemoveIncludeFromWindowsRcFile.patch @@ -0,0 +1,10 @@ +diff --git a/win32/libxml2.rc b/win32/libxml2.rc +index c774a5ee..08e2da1e 100644 +--- a/win32/libxml2.rc ++++ b/win32/libxml2.rc +@@ -1,5 +1,4 @@ + #include +-#include "rcVersion.h" + + VS_VERSION_INFO VERSIONINFO + FILEVERSION LIBXML_MAJOR_VERSION,LIBXML_MINOR_VERSION,LIBXML_MICRO_VERSION,0 diff --git a/ports/libxml2/portfile.cmake b/ports/libxml2/portfile.cmake index de2dfe0afa..f7b0cd81a3 100644 --- a/ports/libxml2/portfile.cmake +++ b/ports/libxml2/portfile.cmake @@ -6,6 +6,8 @@ vcpkg_from_github( REF v2.9.9 SHA512 bfcc08bd033f538a968205f0f9e2da4c3438ec2f35f017289783903365e13ed93d83f2f63c7497344a362b7418170ee586a5ecb45493e30feaa0f62b22a57b54 HEAD_REF master + PATCHES + RemoveIncludeFromWindowsRcFile.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})