diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/seastar/fmt/support/build.gradle | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/seastar/fmt/support/build.gradle')
-rw-r--r-- | src/seastar/fmt/support/build.gradle | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/src/seastar/fmt/support/build.gradle b/src/seastar/fmt/support/build.gradle new file mode 100644 index 00000000..797cf491 --- /dev/null +++ b/src/seastar/fmt/support/build.gradle @@ -0,0 +1,105 @@ + +// General gradle arguments for root project +buildscript { + repositories { + google() + jcenter() + } + dependencies { + // + // https://developer.android.com/studio/releases/gradle-plugin + // + // Notice that 3.1.3 here is the version of [Android Gradle Plugin] + // Accroding to URL above you will need Gradle 4.4 or higher + // + classpath 'com.android.tools.build:gradle:3.1.3' + } +} +repositories { + google() + jcenter() +} + +// Output: Shared library (.so) for Android +apply plugin: 'com.android.library' + +android { + compileSdkVersion 25 // Android 7.0 + + // Target ABI + // - This option controls target platform of module + // - The platform might be limited by compiler's support + // some can work with Clang(default), but some can work only with GCC... + // if bad, both toolchains might not support it + splits { + abi { + enable true + // Specify platforms for Application + reset() + include "arm64-v8a", "armeabi-v7a", "x86_64" + } + } + + defaultConfig { + minSdkVersion 21 // Android 5.0+ + targetSdkVersion 25 // Follow Compile SDK + versionCode 20 // Follow release count + versionName "5.2.1" // Follow Official version + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + + externalNativeBuild { + cmake { + arguments "-DANDROID_STL=c++_shared" // Specify Android STL + arguments "-DBUILD_SHARED_LIBS=true" // Build shared object + arguments "-DFMT_TEST=false" // Skip test + arguments "-DFMT_DOC=false" // Skip document + cppFlags "-std=c++17" + } + } + println("Gradle CMake Plugin: ") + println(externalNativeBuild.cmake.cppFlags) + println(externalNativeBuild.cmake.arguments) + } + + // External Native build + // - Use existing CMakeList.txt + // - Give path to CMake. This gradle file should be + // neighbor of the top level cmake + externalNativeBuild { + cmake { + path "../CMakeLists.txt" + // buildStagingDirectory "./build" // Custom path for cmake output + } + //println(cmake.path) + } + + sourceSets{ + // Android Manifest for Gradle + main { + manifest.srcFile 'AndroidManifest.xml' + } + } +} + +assemble.doLast +{ + // Instead of `ninja install`, Gradle will deploy the files. + // We are doing this since FMT is dependent to the ANDROID_STL after build + copy { + from 'build/intermediates/cmake' + into '../libs' + } + // Copy debug binaries + copy { + from '../libs/debug/obj' + into '../libs/debug' + } + // Copy Release binaries + copy { + from '../libs/release/obj' + into '../libs/release' + } + // Remove empty directory + delete '../libs/debug/obj' + delete '../libs/release/obj' +} |