mirror of
https://github.com/LSPosed/LSPlant.git
synced 2025-05-05 05:56:38 +08:00
Enable LTO
This commit is contained in:
parent
dfcf413b97
commit
1c50c6b808
@ -41,14 +41,6 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
create("standalone") {
|
|
||||||
initWith(getByName("release"))
|
|
||||||
externalNativeBuild {
|
|
||||||
cmake {
|
|
||||||
arguments += "-DANDROID_STL=none"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
all {
|
all {
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
@ -68,7 +60,6 @@ android {
|
|||||||
"-ffunction-sections",
|
"-ffunction-sections",
|
||||||
"-fdata-sections",
|
"-fdata-sections",
|
||||||
"-Wno-unused-value",
|
"-Wno-unused-value",
|
||||||
"-Wl,--gc-sections",
|
|
||||||
"-D__FILE__=__FILE_NAME__",
|
"-D__FILE__=__FILE_NAME__",
|
||||||
"-Wl,--exclude-libs,ALL",
|
"-Wl,--exclude-libs,ALL",
|
||||||
)
|
)
|
||||||
@ -80,16 +71,51 @@ android {
|
|||||||
).joinToString(" ")
|
).joinToString(" ")
|
||||||
arguments(
|
arguments(
|
||||||
"-DCMAKE_CXX_FLAGS_RELEASE=$configFlags",
|
"-DCMAKE_CXX_FLAGS_RELEASE=$configFlags",
|
||||||
"-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=$configFlags",
|
|
||||||
"-DCMAKE_C_FLAGS_RELEASE=$configFlags",
|
"-DCMAKE_C_FLAGS_RELEASE=$configFlags",
|
||||||
"-DCMAKE_C_FLAGS_RELWITHDEBINFO=$configFlags",
|
|
||||||
"-DDEBUG_SYMBOLS_PATH=${project.buildDir.absolutePath}/symbols/$name",
|
"-DDEBUG_SYMBOLS_PATH=${project.buildDir.absolutePath}/symbols/$name",
|
||||||
)
|
)
|
||||||
if (name != "standalone") {
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
externalNativeBuild {
|
||||||
|
val flags = arrayOf(
|
||||||
|
"-Wl,--gc-sections",
|
||||||
|
"-flto",
|
||||||
|
"-fno-unwind-tables",
|
||||||
|
"-fno-asynchronous-unwind-tables",
|
||||||
|
)
|
||||||
|
cmake {
|
||||||
|
cppFlags += flags
|
||||||
|
cFlags += flags
|
||||||
|
arguments += "-DANDROID_STL=c++_shared"
|
||||||
|
arguments += "-DCMAKE_BUILD_TYPE=Release"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
debug {
|
||||||
|
externalNativeBuild {
|
||||||
|
cmake {
|
||||||
arguments += "-DANDROID_STL=c++_shared"
|
arguments += "-DANDROID_STL=c++_shared"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
create("standalone") {
|
||||||
|
initWith(getByName("release"))
|
||||||
|
externalNativeBuild {
|
||||||
|
val flags = arrayOf(
|
||||||
|
"-Wl,--gc-sections",
|
||||||
|
"-flto",
|
||||||
|
"-fno-unwind-tables",
|
||||||
|
"-fno-asynchronous-unwind-tables",
|
||||||
|
)
|
||||||
|
cmake {
|
||||||
|
cppFlags += flags
|
||||||
|
cFlags += flags
|
||||||
|
arguments += "-DANDROID_STL=none"
|
||||||
|
arguments += "-DCMAKE_BUILD_TYPE=Release"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user