diff options
author | 007herelsp <herelsp@msn.cn> | 2021-10-31 17:26:03 +0800 |
---|---|---|
committer | 007herelsp <herelsp@msn.cn> | 2021-10-31 17:54:55 +0800 |
commit | b53b88eb23b2f8a16b829b7d770b1483eaf025f3 (patch) | |
tree | fcb36b2284283d6e2b22843930287ede20ed8b42 | |
parent | 13f9c89ced6ffaeb1faf485152e27e1f40d234cd (diff) | |
download | vSomeIP-b53b88eb23b2f8a16b829b7d770b1483eaf025f3.tar.gz |
fixed android build error
-rw-r--r-- | Android.bp | 85 | ||||
-rw-r--r-- | implementation/configuration/include/configuration_plugin.hpp | 7 | ||||
-rw-r--r-- | implementation/endpoints/include/client_endpoint.hpp | 7 | ||||
-rw-r--r-- | implementation/endpoints/include/endpoint.hpp | 7 | ||||
-rw-r--r-- | implementation/runtime/src/runtime.cpp | 19 | ||||
-rw-r--r-- | implementation/service_discovery/src/service_discovery_impl.cpp | 2 | ||||
-rw-r--r-- | interface/vsomeip/plugin.hpp | 13 |
7 files changed, 131 insertions, 9 deletions
@@ -25,6 +25,18 @@ libvsomeip_sd_srcs = [ cc_defaults { name: "vsomeip_defaults", + + header_libs: [ + "libboost_headers", + ], + + local_include_dirs: [ + "interface", + "implementation/helper/1.70", + ], + + rtti: true, + cppflags: [ "-std=c++11", "-fexceptions", @@ -68,10 +80,13 @@ cc_library_shared { "interface" ], - shared_libs: [ + static_libs: [ "libboost_system", "libboost_thread", "libboost_filesystem", + ], + + shared_libs: [ "liblog", "libutils" ] @@ -119,7 +134,8 @@ cc_library_shared { ], shared_libs: [ - "libvsomeip3" + "libvsomeip3", + "liblog" ] } @@ -142,6 +158,71 @@ cc_library_shared { shared_libs: [ "libvsomeip3", + "liblog", "libboost_thread" ] } + +cc_defaults { + name: "vsomeip_example_defaults", + vendor: true, + owner: "ts", + + shared_libs: [ + "libvsomeip3" + ], +} + +cc_binary { + name: "vsomeip-helloworld-client", + defaults: ["vsomeip_example_defaults"], + + srcs: [ + "examples/hello_world/hello_world_client.cpp", + ], +} + +cc_binary { + name: "vsomeip-helloworld-service", + defaults: ["vsomeip_example_defaults"], + + srcs: [ + "examples/hello_world/hello_world_service.cpp", + ], +} + +cc_binary { + name: "vsomeip-notify-sample", + defaults: ["vsomeip_example_defaults"], + + srcs: [ + "examples/notify-sample.cpp", + ], +} + +cc_binary { + name: "vsomeip-request-sample", + defaults: ["vsomeip_example_defaults"], + + srcs: [ + "examples/request-sample.cpp", + ], +} + +cc_binary { + name: "vsomeip-response-sample", + defaults: ["vsomeip_example_defaults"], + + srcs: [ + "examples/response-sample.cpp", + ], +} + +cc_binary { + name: "vsomeip-subscribe-sample", + defaults: ["vsomeip_example_defaults"], + + srcs: [ + "examples/subscribe-sample.cpp", + ], +} diff --git a/implementation/configuration/include/configuration_plugin.hpp b/implementation/configuration/include/configuration_plugin.hpp index cbb4685..583c3d8 100644 --- a/implementation/configuration/include/configuration_plugin.hpp +++ b/implementation/configuration/include/configuration_plugin.hpp @@ -17,7 +17,12 @@ class configuration; class configuration_plugin { public: - virtual ~configuration_plugin() = default; + virtual ~configuration_plugin() +#ifndef ANDROID + {} +#else + ; +#endif virtual std::shared_ptr<configuration> get_configuration(const std::string &_name) = 0; }; diff --git a/implementation/endpoints/include/client_endpoint.hpp b/implementation/endpoints/include/client_endpoint.hpp index ce872e8..3429a92 100644 --- a/implementation/endpoints/include/client_endpoint.hpp +++ b/implementation/endpoints/include/client_endpoint.hpp @@ -12,7 +12,12 @@ namespace vsomeip_v3 { class client_endpoint : public virtual endpoint { public: - virtual ~client_endpoint() {} + virtual ~client_endpoint() +#ifndef ANDROID + {} +#else + ; +#endif virtual bool get_remote_address(boost::asio::ip::address &_address) const = 0; virtual std::uint16_t get_remote_port() const = 0; diff --git a/implementation/endpoints/include/endpoint.hpp b/implementation/endpoints/include/endpoint.hpp index 452f92b..ccfe96b 100644 --- a/implementation/endpoints/include/endpoint.hpp +++ b/implementation/endpoints/include/endpoint.hpp @@ -22,7 +22,12 @@ public: typedef std::function<void()> error_handler_t; typedef std::function<void(const std::shared_ptr<endpoint>&, service_t)> prepare_stop_handler_t; - virtual ~endpoint() {} + virtual ~endpoint() +#ifndef ANDROID + {} +#else + ; +#endif virtual void start() = 0; virtual void prepare_stop(prepare_stop_handler_t _handler, diff --git a/implementation/runtime/src/runtime.cpp b/implementation/runtime/src/runtime.cpp index 9e79b79..40bb455 100644 --- a/implementation/runtime/src/runtime.cpp +++ b/implementation/runtime/src/runtime.cpp @@ -4,8 +4,12 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. #include <vsomeip/runtime.hpp> +#include <vsomeip/plugin.hpp> #include "../include/runtime_impl.hpp" +#include "../../endpoints/include/endpoint.hpp" +#include "../../endpoints/include/client_endpoint.hpp" +#include "../../configuration/include/configuration_plugin.hpp" namespace vsomeip_v3 { @@ -21,4 +25,19 @@ std::shared_ptr<runtime> runtime::get() { return runtime_impl::get(); } +// non-inline destructors to make typeinfo of the type visible outside the shared library boundary +#ifdef ANDROID +plugin::~plugin() { +} + +endpoint::~endpoint() { +} + +client_endpoint::~client_endpoint() { +} + +configuration_plugin::~configuration_plugin() { +} +#endif + } // namespace vsomeip_v3 diff --git a/implementation/service_discovery/src/service_discovery_impl.cpp b/implementation/service_discovery/src/service_discovery_impl.cpp index b252e62..e7bb267 100644 --- a/implementation/service_discovery/src/service_discovery_impl.cpp +++ b/implementation/service_discovery/src/service_discovery_impl.cpp @@ -3742,8 +3742,10 @@ reliability_type_e service_discovery_impl::get_eventgroup_reliability( << std::hex << std::setw(4) << std::setfill('0') << _instance << "." << std::hex << std::setw(4) << std::setfill('0') << _eventgroup << "]"; } + return its_reliability; } + } // namespace sd } // namespace vsomeip_v3 diff --git a/interface/vsomeip/plugin.hpp b/interface/vsomeip/plugin.hpp index c7b73d9..33667a8 100644 --- a/interface/vsomeip/plugin.hpp +++ b/interface/vsomeip/plugin.hpp @@ -39,7 +39,12 @@ typedef create_plugin_func (*plugin_init_func)(); */ class VSOMEIP_IMPORT_EXPORT_PLUGIN plugin { public: - virtual ~plugin() {} + virtual ~plugin() +#ifndef ANDROID + {} +#else + ; +#endif virtual uint32_t get_plugin_version() const = 0; virtual const std::string &get_plugin_name() const = 0; @@ -60,15 +65,15 @@ public: type_ = _type; } - const std::string &get_plugin_name() const { + const std::string &get_plugin_name() const override { return name_; } - uint32_t get_plugin_version() const { + uint32_t get_plugin_version() const override { return version_; } - plugin_type_e get_plugin_type() const { + plugin_type_e get_plugin_type() const override { return type_; } |