From 5a16e1887e01e6343a9c28cfa853c44b42d68907 Mon Sep 17 00:00:00 2001 From: Quentin Chateau Date: Tue, 14 Apr 2020 00:10:37 +0200 Subject: [PATCH 1/2] packio: add version 1.2.0 --- recipes/packio/all/conandata.yml | 4 ++++ .../all/test_package/{basic.cpp => 1.0.x-1.1.x.cpp} | 0 recipes/packio/all/test_package/1.2.x.cpp | 13 +++++++++++++ recipes/packio/all/test_package/CMakeLists.txt | 11 ++++++++--- recipes/packio/all/test_package/conanfile.py | 5 +++-- recipes/packio/config.yml | 2 ++ 6 files changed, 30 insertions(+), 5 deletions(-) rename recipes/packio/all/test_package/{basic.cpp => 1.0.x-1.1.x.cpp} (100%) create mode 100644 recipes/packio/all/test_package/1.2.x.cpp diff --git a/recipes/packio/all/conandata.yml b/recipes/packio/all/conandata.yml index c04ad0f5b63e0..ed8cb80071a07 100644 --- a/recipes/packio/all/conandata.yml +++ b/recipes/packio/all/conandata.yml @@ -11,3 +11,7 @@ sources: "1.1.1": sha256: 5f77bcbb843cc7dd7731c37db586e9e4f3997ebf04a8d1eccb9eae21841c7e55 url: https://github.com/qchateau/packio/archive/1.1.1.tar.gz + "1.2.0": + sha256: b459c50a2ae7b90b45cd99a727dcd133e48602634571378491533148e642c511 + url: https://github.com/qchateau/packio/archive/1.2.0.tar.gz + diff --git a/recipes/packio/all/test_package/basic.cpp b/recipes/packio/all/test_package/1.0.x-1.1.x.cpp similarity index 100% rename from recipes/packio/all/test_package/basic.cpp rename to recipes/packio/all/test_package/1.0.x-1.1.x.cpp diff --git a/recipes/packio/all/test_package/1.2.x.cpp b/recipes/packio/all/test_package/1.2.x.cpp new file mode 100644 index 0000000000000..82e4fc900d7e3 --- /dev/null +++ b/recipes/packio/all/test_package/1.2.x.cpp @@ -0,0 +1,13 @@ +#include + +namespace ip = boost::asio::ip; + +int main(int, char **) { + boost::asio::io_context io; + + ip::tcp::endpoint bind_ep{ip::make_address("127.0.0.1"), 0}; + auto server = packio::make_server(ip::tcp::acceptor{io, bind_ep}); + auto client = packio::make_client(ip::tcp::socket{io}); + + return 0; +} diff --git a/recipes/packio/all/test_package/CMakeLists.txt b/recipes/packio/all/test_package/CMakeLists.txt index 0929b897977a0..525c308b5ca52 100644 --- a/recipes/packio/all/test_package/CMakeLists.txt +++ b/recipes/packio/all/test_package/CMakeLists.txt @@ -4,6 +4,11 @@ project(TestPackage CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() -add_executable(basic basic.cpp) -target_link_libraries(basic ${CONAN_LIBS}) -set_property(TARGET basic PROPERTY CXX_STANDARD 17) +if (PACKIO_VERSION VERSION_LESS "1.2.0") + add_executable(main 1.0.x-1.1.x.cpp) +else () + add_executable(main 1.2.x.cpp) +endif () + +target_link_libraries(main ${CONAN_LIBS}) +set_property(TARGET main PROPERTY CXX_STANDARD 17) diff --git a/recipes/packio/all/test_package/conanfile.py b/recipes/packio/all/test_package/conanfile.py index fdd31f1c06866..6abc679e121c8 100644 --- a/recipes/packio/all/test_package/conanfile.py +++ b/recipes/packio/all/test_package/conanfile.py @@ -8,10 +8,11 @@ class TestPackageConan(ConanFile): generators = "cmake" def build(self): + packio_version = self.requires['packio'].ref.version cmake = CMake(self) - cmake.configure() + cmake.configure(defs={"PACKIO_VERSION": packio_version}) cmake.build() def test(self): if not tools.cross_building(self.settings): - self.run(os.path.join("bin", "basic"), run_environment=True) + self.run(os.path.join("bin", "main"), run_environment=True) diff --git a/recipes/packio/config.yml b/recipes/packio/config.yml index 62cd2c09bee72..c077b32716044 100644 --- a/recipes/packio/config.yml +++ b/recipes/packio/config.yml @@ -7,3 +7,5 @@ versions: folder: all "1.1.1": folder: all + "1.2.0": + folder: all From faf437172a0cf91f5766055dc3a722a042bf0f79 Mon Sep 17 00:00:00 2001 From: Quentin Chateau Date: Mon, 20 Apr 2020 18:51:32 +0200 Subject: [PATCH 2/2] Update recipes/packio/all/test_package/conanfile.py Co-Authored-By: Daniel --- recipes/packio/all/test_package/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/packio/all/test_package/conanfile.py b/recipes/packio/all/test_package/conanfile.py index 6abc679e121c8..aef41dfda73a3 100644 --- a/recipes/packio/all/test_package/conanfile.py +++ b/recipes/packio/all/test_package/conanfile.py @@ -8,7 +8,7 @@ class TestPackageConan(ConanFile): generators = "cmake" def build(self): - packio_version = self.requires['packio'].ref.version + packio_version = self.deps_cpp_info["packio"].version cmake = CMake(self) cmake.configure(defs={"PACKIO_VERSION": packio_version}) cmake.build()