From f9d6384f71000165eb6aeebc8aeac8aae6d87916 Mon Sep 17 00:00:00 2001 From: amukhamadiev Date: Mon, 13 Apr 2026 23:58:32 +0300 Subject: [PATCH] [fix] compilation of this tag on windows --- include/cloud_point_rpc/{rpc_coder.h => rpc_coder.hpp} | 7 ++++--- meson.build | 5 +++-- src/rpc_coder.cpp | 4 ++-- tests/test_base64.cpp | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) rename include/cloud_point_rpc/{rpc_coder.h => rpc_coder.hpp} (81%) diff --git a/include/cloud_point_rpc/rpc_coder.h b/include/cloud_point_rpc/rpc_coder.hpp similarity index 81% rename from include/cloud_point_rpc/rpc_coder.h rename to include/cloud_point_rpc/rpc_coder.hpp index 8076375..2bc5a3e 100644 --- a/include/cloud_point_rpc/rpc_coder.h +++ b/include/cloud_point_rpc/rpc_coder.hpp @@ -6,16 +6,17 @@ #include #include +#include "export.h" namespace score { -class IRPCCoder { +class CRPC_EXPORT IRPCCoder { public: virtual ~IRPCCoder() = default; virtual std::vector decode(const std::string& encoded) = 0; virtual std::string encode(const std::vector& data) = 0; }; -class Base64RPCCoder final : public IRPCCoder { +class CRPC_EXPORT Base64RPCCoder final : public IRPCCoder { public: Base64RPCCoder(); ~Base64RPCCoder() override; @@ -24,4 +25,4 @@ public: std::string encode(const std::vector& data) override; }; -} \ No newline at end of file +} diff --git a/meson.build b/meson.build index 478b540..2e79ee3 100644 --- a/meson.build +++ b/meson.build @@ -11,17 +11,18 @@ base64_dep = dependency('base64', fallback: ['aklomp-base64', 'base64']) cmake = import('cmake') glog_opt = cmake.subproject_options() glog_opt.add_cmake_defines({ - 'WITH_GFLAGS': 'OFF', + 'WITH_GFLAGS': 'OFF', 'WITH_GTEST': 'OFF', 'CMAKE_POLICY_VERSION_MINIMUM': '3.5' }) libtype = get_option('default_library') -if libtype == 'static' +if libtype == 'static' message('Will share static state with glog') glog_opt.add_cmake_defines({ 'BUILD_SHARED_LIBS': 'OFF', }) + add_project_arguments('-DBASE64_STATIC_DEFINE', '-DYAML_CPP_STATIC_DEFINE', language: 'cpp') endif glog_proj = cmake.subproject('glog', options: glog_opt) diff --git a/src/rpc_coder.cpp b/src/rpc_coder.cpp index ee8aa58..c1f8ece 100644 --- a/src/rpc_coder.cpp +++ b/src/rpc_coder.cpp @@ -1,7 +1,7 @@ // // Created by vptyp on 11.03.2026. // -#include "cloud_point_rpc/rpc_coder.h" +#include "cloud_point_rpc/rpc_coder.hpp" #include "libbase64.h" #include @@ -39,4 +39,4 @@ std::string Base64RPCCoder::encode(const std::vector& data) { DLOG(INFO) << "result_len: " << result_len; return result; } -} \ No newline at end of file +} diff --git a/tests/test_base64.cpp b/tests/test_base64.cpp index a7f2daa..a4190ff 100644 --- a/tests/test_base64.cpp +++ b/tests/test_base64.cpp @@ -7,7 +7,7 @@ #include #include "cloud_point_rpc/config.hpp" -#include "cloud_point_rpc/rpc_coder.h" +#include "cloud_point_rpc/rpc_coder.hpp" class Base64Test : public ::testing::Test { @@ -28,4 +28,4 @@ TEST_F(Base64Test, EncodeDecode) { auto decoded = coder.decode(encoded); EXPECT_EQ(std::ranges::equal(decoded, raw), true); LOG(INFO) << "done"; -} \ No newline at end of file +}