diff options
author | Paul Thomson <paulthomson@users.noreply.github.com> | 2021-09-28 13:28:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-28 14:28:55 +0100 |
commit | 93e89eed2c22deb62b2d0a46a2e376c5132775cd (patch) | |
tree | 638dac80320509529d7e7be043a92e28a7b17194 /samples/amber.cc | |
parent | 6b3fcb0353533d1236035c4aa3b587be5d8b37cd (diff) | |
download | amber-93e89eed2c22deb62b2d0a46a2e376c5132775cd.tar.gz |
Update and improve android_gradle (#965)
* Update CMakeLists.txt files so we can build libamber_ndk.so for
Android via CMake.
* `android_gradle/`:
* Update Gradle version, settings, and build files to match the latest
Android sample. Importantly, this removes the use of jcenter and
bintray repositories, which were shut down.
* Specify NDK version so that Gradle can install required native build
tools automatically.
* Define externalNativeBuild so Gradle can perform the Android CMake
build automatically.
* Replace `main` with `android_main` when building the Amber tool as a
library for Android to avoid compiler warnings, and rename other
Android-related symbols to avoid confusion.
Fixes #964
Diffstat (limited to 'samples/amber.cc')
-rw-r--r-- | samples/amber.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/samples/amber.cc b/samples/amber.cc index d037ba4..5973dba 100644 --- a/samples/amber.cc +++ b/samples/amber.cc @@ -447,7 +447,15 @@ std::string disassemble(const std::string& env, } // namespace +#ifdef AMBER_ANDROID_MAIN +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmissing-prototypes" +#pragma ide diagnostic ignored "OCUnusedGlobalDeclarationInspection" +int android_main(int argc, const char** argv) { +#pragma clang diagnostic pop +#else int main(int argc, const char** argv) { +#endif std::vector<std::string> args(argv, argv + argc); Options options; SampleDelegate delegate; |