Skip to content

Commit 69eb2c2

Browse files
Use single Application.mk file for all CPU arcitectures
1 parent a306cda commit 69eb2c2

File tree

5 files changed

+22
-32
lines changed

5 files changed

+22
-32
lines changed

Diff for: android-database-sqlcipher/build.gradle

+4-3
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ android {
3636
}
3737
}
3838

39-
check.dependsOn editorconfigCheck
4039
clean.dependsOn cleanNative
41-
preBuild.dependsOn([buildOpenSSL, buildAmalgamation])
40+
check.dependsOn editorconfigCheck
41+
buildNative.mustRunAfter buildAmalgamation
42+
buildAmalgamation.mustRunAfter buildOpenSSL
43+
preBuild.dependsOn([buildOpenSSL, buildAmalgamation, buildNative])
4244

4345
afterEvaluate {
4446
android.libraryVariants.all { variant ->
45-
variant.javaCompile.dependsOn(buildNative)
4647
variant.outputs.each { output ->
4748
def outputFile = output.outputFile
4849
if (outputFile != null && outputFile.name.endsWith(".aar")) {

Diff for: android-database-sqlcipher/native.gradle

+7-17
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,15 @@ task buildAmalgamation () {
3535
task buildNative() {
3636
description "Build the native SQLCipher binaries"
3737
doLast {
38-
executeNdkBuild(
39-
"${nativeRootOutputDir}/libs32",
40-
file("src/main/cpp").absolutePath,
41-
file("src/main/cpp/Application32.mk").absolutePath,
42-
"${sqlcipherCFlags}", "${otherSqlcipherCFlags}")
43-
executeNdkBuild(
44-
"${nativeRootOutputDir}/libs64",
45-
file("src/main/cpp").absolutePath,
46-
file("src/main/cpp/Application64.mk").absolutePath,
47-
"${sqlcipherCFlags}", "${otherSqlcipherCFlags}")
4838
exec {
4939
workingDir "${nativeRootOutputDir}"
5040
commandLine "mkdir", "-p", "libs"
5141
}
52-
copy {
53-
from fileTree("${nativeRootOutputDir}/libs32").include("*/*")
54-
into "${nativeRootOutputDir}/libs"
55-
from fileTree("${nativeRootOutputDir}/libs64").include("*/*")
56-
into "${nativeRootOutputDir}/libs"
57-
}
42+
executeNdkBuild(
43+
"${nativeRootOutputDir}/libs",
44+
file("src/main/cpp").absolutePath,
45+
file("src/main/cpp/Application.mk").absolutePath,
46+
"${sqlcipherCFlags}", "${otherSqlcipherCFlags}")
5847
}
5948
}
6049

@@ -123,7 +112,8 @@ def executeNdkBuild(outputDir, androidMkDirectory, applicationMkFile,
123112
"OPENSSL_DIR": "${opensslDir}",
124113
"SQLCIPHER_DIR": "${sqlcipherDir}",
125114
"SQLCIPHER_OTHER_CFLAGS" : "${otherSqlcipherCFlags}",
126-
"ANDROID_NATIVE_ROOT_DIR": "${androidNativeRootDir}"]
115+
"ANDROID_NATIVE_ROOT_DIR": "${androidNativeRootDir}",
116+
"NDK_APP_PLATFORM": "${targetAndroidSdkVersion}"]
127117
environment(environmentVariables)
128118
commandLine "ndk-build", "${ndkBuildType}",
129119
"--environment-overrides", outputDirectory,
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
APP_PROJECT_PATH := $(shell pwd)
2+
APP_ABI := armeabi armeabi-v7a x86 x86_64 arm64-v8a
3+
APP_PLATFORM := android-$(NDK_APP_PLATFORM)
4+
APP_BUILD_SCRIPT := $(APP_PROJECT_PATH)/Android.mk
5+
APP_STL := stlport_static
6+
ifeq ($(TARGET_ARCH_ABI),$(filter $(TARGET_ARCH_ABI),armeabi armeabi-v7a x86))
7+
APP_CFLAGS := -D_FILE_OFFSET_BITS=32
8+
else
9+
APP_CFLAGS := -D_FILE_OFFSET_BITS=64
10+
endif
11+
APP_LDFLAGS += -Wl,--exclude-libs,ALL

Diff for: android-database-sqlcipher/src/main/cpp/Application32.mk

-6
This file was deleted.

Diff for: android-database-sqlcipher/src/main/cpp/Application64.mk

-6
This file was deleted.

0 commit comments

Comments
 (0)