From 5561d99f5a53bce170e21a1ce74ae8d1bf7c8297 Mon Sep 17 00:00:00 2001 From: toge Date: Sun, 22 Sep 2024 00:03:03 +0900 Subject: [PATCH 1/3] proxy: add version 3.0.0 --- recipes/proxy/all/conandata.yml | 3 +++ recipes/proxy/all/test_package/CMakeLists.txt | 3 +++ .../proxy/all/test_package/test_package.cpp | 24 +++++++++++++++++++ recipes/proxy/config.yml | 2 ++ 4 files changed, 32 insertions(+) diff --git a/recipes/proxy/all/conandata.yml b/recipes/proxy/all/conandata.yml index 3833bc86e0c87..cb63d289fe25b 100644 --- a/recipes/proxy/all/conandata.yml +++ b/recipes/proxy/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.0": + url: "https://github.com/microsoft/proxy/archive/refs/tags/3.0.0.tar.gz" + sha256: "7e073e217e5572bc4c17ed5893273c80ea34c87e1406c853beeb9ca9bdda9733" "2.4.0": url: "https://github.com/microsoft/proxy/archive/refs/tags/2.4.0.tar.gz" sha256: "7eed973655938d681a90dcc0c200e6cc1330ea8611a9c1a9e1b30439514443cb" diff --git a/recipes/proxy/all/test_package/CMakeLists.txt b/recipes/proxy/all/test_package/CMakeLists.txt index 7ca64396c7e13..12e4ed6043780 100644 --- a/recipes/proxy/all/test_package/CMakeLists.txt +++ b/recipes/proxy/all/test_package/CMakeLists.txt @@ -6,3 +6,6 @@ find_package(proxy REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE msft_proxy) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) +if(proxy_VERSION VERSION_GREATER_EQUAL "3.0.0") + target_compile_definitions(${PROJECT_NAME} PRIVATE PROXY_VERSION_3_LATER) +endif() \ No newline at end of file diff --git a/recipes/proxy/all/test_package/test_package.cpp b/recipes/proxy/all/test_package/test_package.cpp index 09afe4defb583..76203347d76e0 100644 --- a/recipes/proxy/all/test_package/test_package.cpp +++ b/recipes/proxy/all/test_package/test_package.cpp @@ -26,6 +26,29 @@ #include #include +#ifdef PROXY_VERSION_3_LATER + +PRO_DEF_MEM_DISPATCH(MemAt, at); + +struct Dictionary : pro::facade_builder + ::add_convention + ::build {}; + +// This is a function, rather than a function template +void demo_print(pro::proxy dictionary) { + std::cout << dictionary->at(1) << "\n"; +} + +int main() { + static std::map container1{{1, "hello"}}; + auto container2 = std::make_shared>(); + container2->push_back("hello"); + container2->push_back("world"); + demo_print(&container1); // Prints: "hello" + demo_print(container2); // Prints: "world" +} + +#else namespace poly { @@ -45,3 +68,4 @@ int main() { demo_print(&container2); // print: world\n return 0; } +#endif \ No newline at end of file diff --git a/recipes/proxy/config.yml b/recipes/proxy/config.yml index e219a60af9483..fd53bc176b690 100644 --- a/recipes/proxy/config.yml +++ b/recipes/proxy/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.0": + folder: all "2.4.0": folder: all "2.3.2": From 2090e9ce9f6711bab8f11248e86e5673ac0e639a Mon Sep 17 00:00:00 2001 From: toge Date: Sun, 22 Sep 2024 00:06:36 +0900 Subject: [PATCH 2/3] add end of line --- recipes/proxy/all/test_package/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/proxy/all/test_package/CMakeLists.txt b/recipes/proxy/all/test_package/CMakeLists.txt index 12e4ed6043780..6ed6216423b01 100644 --- a/recipes/proxy/all/test_package/CMakeLists.txt +++ b/recipes/proxy/all/test_package/CMakeLists.txt @@ -8,4 +8,4 @@ target_link_libraries(${PROJECT_NAME} PRIVATE msft_proxy) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20) if(proxy_VERSION VERSION_GREATER_EQUAL "3.0.0") target_compile_definitions(${PROJECT_NAME} PRIVATE PROXY_VERSION_3_LATER) -endif() \ No newline at end of file +endif() From abc883b8099c83a6c27d5b6bf59d5d0bd08a85d4 Mon Sep 17 00:00:00 2001 From: toge Date: Sun, 22 Sep 2024 00:06:58 +0900 Subject: [PATCH 3/3] add end of line --- recipes/proxy/all/test_package/test_package.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/proxy/all/test_package/test_package.cpp b/recipes/proxy/all/test_package/test_package.cpp index 76203347d76e0..4700fd6cd057e 100644 --- a/recipes/proxy/all/test_package/test_package.cpp +++ b/recipes/proxy/all/test_package/test_package.cpp @@ -68,4 +68,4 @@ int main() { demo_print(&container2); // print: world\n return 0; } -#endif \ No newline at end of file +#endif