From 39865e8ad572edf4aa72700e55acf89e6608c5a6 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 28 Apr 2023 23:28:18 +0800 Subject: [PATCH] improve grpc tests (#2043) * improve grpc tests * add corefoundation for abseil --- packages/a/abseil/xmake.lua | 4 ++++ packages/g/grpc/xmake.lua | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/a/abseil/xmake.lua b/packages/a/abseil/xmake.lua index d483f7cad..5765dce51 100644 --- a/packages/a/abseil/xmake.lua +++ b/packages/a/abseil/xmake.lua @@ -37,6 +37,10 @@ package("abseil") "absl_strerror", "absl_examine_stack", "absl_low_level_hash", "absl_random_seed_gen_exception", "absl_civil_time", "absl_crc_cord_state", "absl_crc32c", "absl_crc_cpu_detect", "absl_crc_internal") + if is_plat("macosx") then + add_frameworks("CoreFoundation") + end + on_load(function (package) if package:is_plat("windows") and package:config("shared") then package:add("defines", "ABSL_CONSUME_DLL") diff --git a/packages/g/grpc/xmake.lua b/packages/g/grpc/xmake.lua index fb57c2433..93199f8d1 100644 --- a/packages/g/grpc/xmake.lua +++ b/packages/g/grpc/xmake.lua @@ -52,8 +52,12 @@ package("grpc") on_test(function (package) assert(package:check_cxxsnippets({test = [[ + #include void test() { grpc::CompletionQueue q; + std::string server_address("192.168.28.109:9010"); + auto channel = grpc::CreateChannel(server_address, grpc::InsecureChannelCredentials()); + std::cout << &channel << std::endl; } ]]}, {configs = {languages = "c++17"}, includes = "grpcpp/grpcpp.h"})) end)