Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix reflect-cpp compilation when msgpack is enabled #6205

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/r/reflect-cpp/patches/0.16.0/cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2e16468..38d289f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -138,7 +138,7 @@ if (REFLECTCPP_MSGPACK)
if(REFLECTCPP_USE_VCPKG)
find_package(msgpack-c CONFIG REQUIRED)
else()
- find_package(msgpack CONFIG REQUIRED)
+ find_package(msgpack-c CONFIG REQUIRED)
endif()
target_link_libraries(reflectcpp PUBLIC msgpack-c)
endif ()
19 changes: 19 additions & 0 deletions packages/r/reflect-cpp/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ package("reflect-cpp")
add_versions("v0.11.1", "e45f112fb3f14507a4aa53b99ae2d4ab6a4e7b2d5f04dd06fec00bf7faa7bbdc")
add_versions("v0.10.0", "d2c8876d993ddc8c57c5804e767786bdb46a2bdf1a6cd81f4b14f57b1552dfd7")

add_patches("0.16.0", "patches/0.16.0/cmake.patch", "1b2a6e0ed81dd0bd373bd1daaf52010de965f3829e5e19406c53e8ebf0a5b9fc")
add_patches("0.11.1", "patches/0.11.1/cmake.patch", "a43ae2c6de455054ab860adfb309da7bd376c31c493c8bab0ebe07aae0805205")
add_patches("0.10.0", "patches/0.10.0/cmake.patch", "b8929c0a13bd4045cbdeea0127e08a784e2dc8c43209ca9f056fff4a3ab5c4d3")

Expand Down Expand Up @@ -141,4 +142,22 @@ package("reflect-cpp")
auto homer2 = rfl::json::read<Person>(json_string).value();
}
]]}, {configs = {languages = "c++20"}}))
if package:config("msgpack") then
assert(package:check_cxxsnippets({test = [[
#include <rfl/msgpack.hpp>
#include <rfl.hpp>
struct Person {
std::string first_name;
std::string last_name;
int age;
};
const auto homer = Person{.first_name = "Homer",
.last_name = "Simpson",
.age = 45};
void test() {
std::vector<char> msgpack_str_vec = rfl::msgpack::write(homer);
auto homer2 = rfl::msgpack::read<Person>(msgpack_str_vec).value();
}
]]}, {configs = {languages = "c++20"}}))
end
end)
Loading