Skip to content

Commit

Permalink
Use cmake 3.22.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 committed May 24, 2022
1 parent a4d5820 commit f432089
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,8 @@ android {
"-fno-stack-protector",
"-fomit-frame-pointer",
"-Wno-builtin-macro-redefined",
"-ffunction-sections",
"-fdata-sections",
"-Wno-unused-value",
"-Wl,--gc-sections",
"-D__FILE__=__FILE_NAME__",
"-Wl,--exclude-libs,ALL",
)
cppFlags("-std=c++20", *flags)
cFlags("-std=c18", *flags)
Expand Down Expand Up @@ -110,27 +106,47 @@ android {
"config"
)
}
debug {
externalNativeBuild {
cmake {
arguments.addAll(
arrayOf(
"-DCMAKE_CXX_FLAGS_DEBUG=-Og",
"-DCMAKE_C_FLAGS_DEBUG=-Og",
)
)
}
}
}
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles("proguard-rules.pro")
externalNativeBuild {
cmake {
cppFlags += "-flto"
val flags =arrayOf(
"-flto",
"-ffunction-sections",
"-fdata-sections",
"-Wl,--gc-sections",
"-fno-unwind-tables",
"-fno-asynchronous-unwind-tables",
"-Wl,--exclude-libs,ALL",
)
cppFlags.addAll(flags)
cFlags.addAll(flags)
val configFlags = arrayOf(
"-Oz",
"-DNDEBUG"
).joinToString(" ")
arguments(
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_CXX_FLAGS_RELEASE=$configFlags",
"-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=$configFlags",
"-DCMAKE_C_FLAGS_RELEASE=$configFlags",
"-DCMAKE_C_FLAGS_RELWITHDEBINFO=$configFlags",
"-DDEBUG_SYMBOLS_PATH=${project.buildDir.absolutePath}/symbols/$name",
)
}
}

}
}

Expand Down Expand Up @@ -179,6 +195,7 @@ android {
externalNativeBuild {
cmake {
path("src/main/jni/CMakeLists.txt")
version = "3.22.1+"
}
}
namespace = "me.iacn.biliroaming"
Expand Down

0 comments on commit f432089

Please sign in to comment.