From 641128c6039a5a251e7da470f164e8a9c98a1b02 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 9 Feb 2018 22:56:36 -0800 Subject: [folly] Workaround bug for VS 15.6 --- ports/folly/CONTROL | 2 +- ports/folly/cmake-link-boost-fix.cmake | 35 ---------------------------------- ports/folly/cmake-link-boost-fix.patch | 35 ++++++++++++++++++++++++++++++++++ ports/folly/msvc-15.6-workaround.patch | 25 ++++++++++++++++++++++++ ports/folly/portfile.cmake | 3 ++- 5 files changed, 63 insertions(+), 37 deletions(-) delete mode 100644 ports/folly/cmake-link-boost-fix.cmake create mode 100644 ports/folly/cmake-link-boost-fix.patch create mode 100644 ports/folly/msvc-15.6-workaround.patch diff --git a/ports/folly/CONTROL b/ports/folly/CONTROL index cc3678039..8f0bb7656 100644 --- a/ports/folly/CONTROL +++ b/ports/folly/CONTROL @@ -1,4 +1,4 @@ Source: folly -Version: 2017.11.27.00-2 +Version: 2017.11.27.00-3 Description: An open-source C++ library developed and used at Facebook. The library is UNSTABLE on Windows Build-Depends: zlib, openssl, libevent, double-conversion, glog, gflags, lz4, liblzma, snappy, boost-context, boost-chrono, boost-date-time, boost-filesystem, boost-program-options, boost-regex, boost-system, boost-thread, boost-conversion, boost-multi-index, boost-crc diff --git a/ports/folly/cmake-link-boost-fix.cmake b/ports/folly/cmake-link-boost-fix.cmake deleted file mode 100644 index 7eb4574c4..000000000 --- a/ports/folly/cmake-link-boost-fix.cmake +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ec5a985c..36564534 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -136,13 +136,6 @@ source_group("folly\\build" FILES - ) - - set(FOLLY_SHINY_DEPENDENCIES -- Boost::chrono -- Boost::context -- Boost::date_time -- Boost::filesystem -- Boost::program_options -- Boost::regex -- Boost::system - OpenSSL::SSL - OpenSSL::Crypto - ) -@@ -179,6 +172,7 @@ endif() - - set(FOLLY_LINK_LIBRARIES - ${FOLLY_LINK_LIBRARIES} -+ ${Boost_LIBRARIES} - Iphlpapi.lib - Ws2_32.lib - -@@ -320,7 +314,7 @@ if (BUILD_TESTS) - ) - target_link_libraries(folly_test_support - PUBLIC -- Boost::thread -+ ${Boost_LIBRARIES} - folly - ${LIBGMOCK_LIBRARY} - ) diff --git a/ports/folly/cmake-link-boost-fix.patch b/ports/folly/cmake-link-boost-fix.patch new file mode 100644 index 000000000..d3baf13a3 --- /dev/null +++ b/ports/folly/cmake-link-boost-fix.patch @@ -0,0 +1,35 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ec5a985c..36564534 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -136,13 +136,6 @@ source_group("folly\\build" FILES + ) + + set(FOLLY_SHINY_DEPENDENCIES +- Boost::chrono +- Boost::context +- Boost::date_time +- Boost::filesystem +- Boost::program_options +- Boost::regex +- Boost::system + OpenSSL::SSL + OpenSSL::Crypto + ) +@@ -179,6 +172,7 @@ endif() + + set(FOLLY_LINK_LIBRARIES + ${FOLLY_LINK_LIBRARIES} ++ ${Boost_LIBRARIES} + Iphlpapi.lib + Ws2_32.lib + +@@ -320,7 +314,7 @@ if (BUILD_TESTS) + ) + target_link_libraries(folly_test_support + PUBLIC +- Boost::thread ++ ${Boost_LIBRARIES} + folly + ${LIBGMOCK_LIBRARY} + ) diff --git a/ports/folly/msvc-15.6-workaround.patch b/ports/folly/msvc-15.6-workaround.patch new file mode 100644 index 000000000..6102f32ac --- /dev/null +++ b/ports/folly/msvc-15.6-workaround.patch @@ -0,0 +1,25 @@ +diff --git a/folly/FBString.h b/folly/FBString.h +index 4882aac..6c83046 100644 +--- a/folly/FBString.h ++++ b/folly/FBString.h +@@ -1890,12 +1890,14 @@ inline basic_fbstring& basic_fbstring::operator=( + + template + template +-inline typename std::enable_if< +- std::is_same< +- typename std::decay::type, +- typename basic_fbstring::value_type>::value, +- basic_fbstring&>::type +-basic_fbstring::operator=(TP c) { ++inline auto ++basic_fbstring::operator=(TP c) ++ -> typename std::enable_if< ++ std::is_same< ++ typename std::decay::type, ++ typename basic_fbstring::value_type>::value, ++ basic_fbstring&>::type ++{ + Invariant checker(*this); + + if (empty()) { diff --git a/ports/folly/portfile.cmake b/ports/folly/portfile.cmake index 77c8cecdf..00c1093da 100644 --- a/ports/folly/portfile.cmake +++ b/ports/folly/portfile.cmake @@ -25,7 +25,8 @@ vcpkg_from_github( vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES - ${CMAKE_CURRENT_LIST_DIR}/cmake-link-boost-fix.cmake + ${CMAKE_CURRENT_LIST_DIR}/cmake-link-boost-fix.patch + ${CMAKE_CURRENT_LIST_DIR}/msvc-15.6-workaround.patch ) if(VCPKG_CRT_LINKAGE STREQUAL static) -- cgit v1.2.3