summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlutzbichler <52852266+lutzbichler@users.noreply.github.com>2022-03-15 07:11:23 +0100
committerGitHub <noreply@github.com>2022-03-15 07:11:23 +0100
commit18e8b7f98c3ecc9cf3bc7bd6c5c1098ad397d9ac (patch)
tree3aac50c0bb94b7eb67651adff00fc8e8f70359af
parent01faa10d1c64254f394857cf9fb9a1e90d2a442e (diff)
parentb53b88eb23b2f8a16b829b7d770b1483eaf025f3 (diff)
downloadvSomeIP-18e8b7f98c3ecc9cf3bc7bd6c5c1098ad397d9ac.tar.gz
Merge pull request #288 from 007herelsp/master
fixed android build error
-rw-r--r--Android.bp85
-rw-r--r--implementation/configuration/include/configuration_plugin.hpp7
-rw-r--r--implementation/endpoints/include/client_endpoint.hpp7
-rw-r--r--implementation/endpoints/include/endpoint.hpp7
-rw-r--r--implementation/runtime/src/runtime.cpp19
-rw-r--r--implementation/service_discovery/src/service_discovery_impl.cpp2
-rw-r--r--interface/vsomeip/plugin.hpp13
7 files changed, 131 insertions, 9 deletions
diff --git a/Android.bp b/Android.bp
index 276d4aa..95a3625 100644
--- a/Android.bp
+++ b/Android.bp
@@ -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 5075cf1..1f5dc07 100644
--- a/implementation/service_discovery/src/service_discovery_impl.cpp
+++ b/implementation/service_discovery/src/service_discovery_impl.cpp
@@ -3732,8 +3732,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_;
}