From 6382743d26f8d5bb10a53cb907659bee6614b549 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 11 Oct 2014 00:43:05 +0300 Subject: [PATCH] Force shared linking on Android Android applications are not run as standalone programs, but instead loaded as native libraries into the Java VM. --- source/androidlinker.cpp | 7 +++++++ source/androidlinker.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/source/androidlinker.cpp b/source/androidlinker.cpp index 8b7685b..5f35446 100644 --- a/source/androidlinker.cpp +++ b/source/androidlinker.cpp @@ -1,9 +1,16 @@ #include "androidlinker.h" #include "androidtools.h" +using namespace std; + AndroidLinker::AndroidLinker(Builder &b, const Architecture &a, const AndroidNdk &ndk): GnuLinker(b, a, ndk.get_platform_sysroot()) { set_command((ndk.get_bin_dir()/command).str()); build_info.libpath.insert(build_info.libpath.end(), system_path.begin(), system_path.end()); } + +Target *AndroidLinker::create_target(const list &sources, const string &) +{ + return GnuLinker::create_target(sources, "shared"); +} diff --git a/source/androidlinker.h b/source/androidlinker.h index 5f30fcd..2c9ea72 100644 --- a/source/androidlinker.h +++ b/source/androidlinker.h @@ -9,6 +9,8 @@ class AndroidLinker: public GnuLinker { public: AndroidLinker(Builder &, const Architecture &, const AndroidNdk &); + + virtual Target *create_target(const std::list &, const std::string &); }; #endif -- 2.45.2