From 38b4d5e457e9157df542ad24d4ae593f5cb95fcf Mon Sep 17 00:00:00 2001 From: SSE4 Date: Mon, 20 Jan 2020 15:54:41 +0700 Subject: [PATCH 1/6] - add patch for 1.72 Signed-off-by: SSE4 --- recipes/boost/all/conandata.yml | 2 + ...001-revert-cease-dependence-on-range.patch | 49 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 recipes/boost/all/patches/0001-revert-cease-dependence-on-range.patch diff --git a/recipes/boost/all/conandata.yml b/recipes/boost/all/conandata.yml index 555160d947c52..41e8bcb9c37ab 100644 --- a/recipes/boost/all/conandata.yml +++ b/recipes/boost/all/conandata.yml @@ -56,3 +56,5 @@ patches: base_path: "boost_1_72_0" - patch_file: "patches/solaris_pthread_data.patch" base_path: "boost_1_72_0" + - patch_file: "patches/0001-revert-cease-dependence-on-range.patch" + base_path: "boost_1_72_0" diff --git a/recipes/boost/all/patches/0001-revert-cease-dependence-on-range.patch b/recipes/boost/all/patches/0001-revert-cease-dependence-on-range.patch new file mode 100644 index 0000000000000..a6002074ab937 --- /dev/null +++ b/recipes/boost/all/patches/0001-revert-cease-dependence-on-range.patch @@ -0,0 +1,49 @@ +From 436e1dbe6fcd31523d261d18ad011392f1d6fbbc Mon Sep 17 00:00:00 2001 +From: Oliver Kowalke +Date: Sun, 1 Dec 2019 20:40:28 +0100 +Subject: [PATCH] Revert "Cease dependence on Range" + +This reverts commit 0c556bb59241e682bbcd3f572815149c5a9b17db. + +see #44 (One test fails to compile after boostorg/coroutine submodule updated) +--- + boost/coroutine/asymmetric_coroutine.hpp | 12 +++--------- + 1 file changed, 3 insertions(+), 9 deletions(-) + +diff --git a/boost/coroutine/asymmetric_coroutine.hpp b/boost/coroutine/asymmetric_coroutine.hpp +index ea96981..640896f 100644 +--- a/boost/coroutine/asymmetric_coroutine.hpp ++++ b/boost/coroutine/asymmetric_coroutine.hpp +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -2354,19 +2355,12 @@ end( push_coroutine< R > & c) + + } + +-// forward declaration of Boost.Range traits to break dependency on it +-template +-struct range_mutable_iterator; +- +-template +-struct range_const_iterator; +- + template< typename Arg > +-struct range_mutable_iterator< coroutines::push_coroutine< Arg >, void > ++struct range_mutable_iterator< coroutines::push_coroutine< Arg > > + { typedef typename coroutines::push_coroutine< Arg >::iterator type; }; + + template< typename R > +-struct range_mutable_iterator< coroutines::pull_coroutine< R >, void > ++struct range_mutable_iterator< coroutines::pull_coroutine< R > > + { typedef typename coroutines::pull_coroutine< R >::iterator type; }; + + } +-- +2.24.1 + From 0bd551c799b03923b32b0d34bba1e46e1a22f628 Mon Sep 17 00:00:00 2001 From: SSE4 Date: Wed, 12 Feb 2020 18:07:52 +0700 Subject: [PATCH 2/6] - cherry-pick patch into 1.72 Signed-off-by: SSE4 --- .../patches/0001-revert-cease-dependence-on-range.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/boost/all/patches/0001-revert-cease-dependence-on-range.patch b/recipes/boost/all/patches/0001-revert-cease-dependence-on-range.patch index a6002074ab937..fd069197a95a0 100644 --- a/recipes/boost/all/patches/0001-revert-cease-dependence-on-range.patch +++ b/recipes/boost/all/patches/0001-revert-cease-dependence-on-range.patch @@ -1,4 +1,4 @@ -From 436e1dbe6fcd31523d261d18ad011392f1d6fbbc Mon Sep 17 00:00:00 2001 +From 188eac4acf37313fcec27d7b266c6517b99ed23d Mon Sep 17 00:00:00 2001 From: Oliver Kowalke Date: Sun, 1 Dec 2019 20:40:28 +0100 Subject: [PATCH] Revert "Cease dependence on Range" @@ -11,7 +11,7 @@ see #44 (One test fails to compile after boostorg/coroutine submodule updated) 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/boost/coroutine/asymmetric_coroutine.hpp b/boost/coroutine/asymmetric_coroutine.hpp -index ea96981..640896f 100644 +index f2ae16f..78b1842 100644 --- a/boost/coroutine/asymmetric_coroutine.hpp +++ b/boost/coroutine/asymmetric_coroutine.hpp @@ -14,6 +14,7 @@ @@ -22,7 +22,7 @@ index ea96981..640896f 100644 #include #include -@@ -2354,19 +2355,12 @@ end( push_coroutine< R > & c) +@@ -2390,19 +2391,12 @@ end( push_coroutine< R > & c) } @@ -45,5 +45,5 @@ index ea96981..640896f 100644 } -- -2.24.1 +2.21.0 From 7c8218d7da2a9ee8d420da65d3d5f783e823897b Mon Sep 17 00:00:00 2001 From: SSE4 Date: Wed, 12 Feb 2020 18:09:01 +0700 Subject: [PATCH 3/6] - add simple test for coroutine Signed-off-by: SSE4 --- recipes/boost/all/test_package/CMakeLists.txt | 8 ++++++++ recipes/boost/all/test_package/conanfile.py | 2 ++ recipes/boost/all/test_package/coroutine.cpp | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 recipes/boost/all/test_package/coroutine.cpp diff --git a/recipes/boost/all/test_package/CMakeLists.txt b/recipes/boost/all/test_package/CMakeLists.txt index 97151ea259673..3d085fb93f116 100644 --- a/recipes/boost/all/test_package/CMakeLists.txt +++ b/recipes/boost/all/test_package/CMakeLists.txt @@ -13,6 +13,9 @@ CONAN_BASIC_SETUP() IF(NOT HEADER_ONLY) set(boost_components) + if (WITH_COROUTINE) + list(APPEND boost_components coroutine) + endif() if (WITH_PYTHON) list(APPEND boost_components python) endif() @@ -45,6 +48,11 @@ IF(NOT HEADER_ONLY) TARGET_LINK_LIBRARIES(test ${CONAN_LIBS}) endif() + if (WITH_COROUTINE) + ADD_EXECUTABLE(coroutine_exe coroutine.cpp) + TARGET_LINK_LIBRARIES(coroutine_exe ${Boost_LIBRARIES}) + endif() + if(WITH_PYTHON) add_library(hello_ext SHARED python.cpp) if(WIN32) diff --git a/recipes/boost/all/test_package/conanfile.py b/recipes/boost/all/test_package/conanfile.py index 9de211d7d024b..db1c4b3681d49 100644 --- a/recipes/boost/all/test_package/conanfile.py +++ b/recipes/boost/all/test_package/conanfile.py @@ -22,6 +22,8 @@ def build(self): cmake.definitions["WITH_REGEX"] = "TRUE" if not self.options["boost"].without_test: cmake.definitions["WITH_TEST"] = "TRUE" + if not self.options["boost"].without_coroutine: + cmake.definitions["WITH_COROUTINE"] = "TRUE" cmake.configure() cmake.build() diff --git a/recipes/boost/all/test_package/coroutine.cpp b/recipes/boost/all/test_package/coroutine.cpp new file mode 100644 index 0000000000000..ed1cb6f6d07d5 --- /dev/null +++ b/recipes/boost/all/test_package/coroutine.cpp @@ -0,0 +1,19 @@ +#include +#include + +using namespace boost::coroutines; + +void cooperative(coroutine::push_type &sink) +{ + std::cout << "Hello"; + sink(); + std::cout << "world"; +} + +int main() +{ + coroutine::pull_type source{cooperative}; + std::cout << ", "; + source(); + std::cout << "!\n"; +} From 7ae3b8deb63f4cd8cdbad6f665f110859ef4d826 Mon Sep 17 00:00:00 2001 From: SSE4 Date: Wed, 12 Feb 2020 18:52:54 +0700 Subject: [PATCH 4/6] - bad merge :( Signed-off-by: SSE4 --- recipes/boost/all/test_package/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/boost/all/test_package/CMakeLists.txt b/recipes/boost/all/test_package/CMakeLists.txt index 92c4379d43c8c..d16f2b4ad46a4 100644 --- a/recipes/boost/all/test_package/CMakeLists.txt +++ b/recipes/boost/all/test_package/CMakeLists.txt @@ -54,6 +54,7 @@ IF(NOT HEADER_ONLY) if (WITH_COROUTINE) ADD_EXECUTABLE(coroutine_exe coroutine.cpp) TARGET_LINK_LIBRARIES(coroutine_exe ${Boost_LIBRARIES}) + endif() if (WITH_CHRONO) ADD_EXECUTABLE(chrono_exe chrono.cpp) From 834e92f1acdeb89ae3179379db010f5ae07d4ca3 Mon Sep 17 00:00:00 2001 From: SSE4 Date: Wed, 12 Feb 2020 22:38:27 +0700 Subject: [PATCH 5/6] - avoid C++11 Signed-off-by: SSE4 --- recipes/boost/all/test_package/coroutine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/boost/all/test_package/coroutine.cpp b/recipes/boost/all/test_package/coroutine.cpp index ed1cb6f6d07d5..85f05a83d646a 100644 --- a/recipes/boost/all/test_package/coroutine.cpp +++ b/recipes/boost/all/test_package/coroutine.cpp @@ -12,7 +12,7 @@ void cooperative(coroutine::push_type &sink) int main() { - coroutine::pull_type source{cooperative}; + coroutine::pull_type source(cooperative); std::cout << ", "; source(); std::cout << "!\n"; From 835f4b7aaa613f122fa653a5f1ffa4d55459dcf7 Mon Sep 17 00:00:00 2001 From: SSE4 Date: Wed, 12 Feb 2020 10:18:15 -0800 Subject: [PATCH 6/6] Update CMakeLists.txt --- recipes/boost/all/test_package/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/boost/all/test_package/CMakeLists.txt b/recipes/boost/all/test_package/CMakeLists.txt index d16f2b4ad46a4..7ede1feaec771 100644 --- a/recipes/boost/all/test_package/CMakeLists.txt +++ b/recipes/boost/all/test_package/CMakeLists.txt @@ -15,6 +15,7 @@ IF(NOT HEADER_ONLY) set(boost_components) if (WITH_COROUTINE) list(APPEND boost_components coroutine) + list(APPEND boost_components thread) endif() if (WITH_PYTHON) list(APPEND boost_components python)