From b46bb2f913f553c75af115e7d1106797f491913f Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Fri, 28 Jul 2017 16:54:57 -0700 Subject: [PATCH] [vcpkg] add a patch for empty string literal --- ports/libkml/patch_empty_literal_on_vc.patch | 13 +++++++++++++ ports/libkml/portfile.cmake | 7 +++++++ 2 files changed, 20 insertions(+) create mode 100644 ports/libkml/patch_empty_literal_on_vc.patch diff --git a/ports/libkml/patch_empty_literal_on_vc.patch b/ports/libkml/patch_empty_literal_on_vc.patch new file mode 100644 index 000000000..8a3581a05 --- /dev/null +++ b/ports/libkml/patch_empty_literal_on_vc.patch @@ -0,0 +1,13 @@ +diff --git a/src/kml/base/file_win32.cc b/src/kml/base/file_win32.cc +index c46e099..28ccb36 100644 +--- a/src/kml/base/file_win32.cc ++++ b/src/kml/base/file_win32.cc +@@ -42,7 +42,7 @@ namespace kmlbase { + // Internal to the win32 file class. We need a conversion from string to + // LPCWSTR. + static std::wstring Str2Wstr(const string& str) { +- std::wstring wstr(str.length(), L''); ++ std::wstring wstr(str.length(), L' '); + std::copy(str.begin(), str.end(), wstr.begin()); + return wstr; + } diff --git a/ports/libkml/portfile.cmake b/ports/libkml/portfile.cmake index 8aaa96957..5d2f014f8 100644 --- a/ports/libkml/portfile.cmake +++ b/ports/libkml/portfile.cmake @@ -7,6 +7,13 @@ vcpkg_from_github( HEAD_REF master ) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + "${CMAKE_CURRENT_LIST_DIR}/patch_empty_literal_on_vc.patch" +) + + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} )