Stablize CMake arguments (#2266)

This commit is contained in:
LoveSy 2022-12-03 14:41:54 +08:00 committed by GitHub
parent 2327e7b398
commit 6d80cd62fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 6 deletions

View File

@ -125,8 +125,6 @@ fun Project.configureBaseExtension() {
cFlags("-std=c18", *flags)
arguments(
"-DANDROID_STL=none",
"-DVERSION_CODE=$verCode",
"-DVERSION_NAME=$verName",
)
findInPath("ccache")?.let {
println("Using ccache $it")

1
core/.gitignore vendored
View File

@ -1,2 +1,3 @@
/build
/.cxx
/src/main/jni/src/config.cpp

View File

@ -18,6 +18,8 @@
*/
val apiCode: Int by rootProject.extra
val verName: String by rootProject.extra
val verCode: Int by rootProject.extra
plugins {
id("com.android.library")
@ -43,6 +45,12 @@ android {
}
}
}
copy {
from("src/main/jni/template/") {
expand("VERSION_CODE" to "$verCode", "VERSION_NAME" to verName)
}
into("src/main/jni/src/")
}
dependencies {
implementation("org.apache.commons:commons-lang3:3.12.0")

View File

@ -3,12 +3,10 @@ cmake_minimum_required(VERSION 3.4.1)
add_subdirectory(${EXTERNAL_ROOT} external)
configure_file(template/config.cpp src/config.cpp)
aux_source_directory(src SRC_LIST)
aux_source_directory(src/jni SRC_LIST)
add_library(${PROJECT_NAME} STATIC ${SRC_LIST} ${CMAKE_CURRENT_BINARY_DIR}/src/config.cpp)
add_library(${PROJECT_NAME} STATIC ${SRC_LIST})
target_include_directories(${PROJECT_NAME} PUBLIC include)
target_include_directories(${PROJECT_NAME} PRIVATE src)

View File

@ -122,7 +122,6 @@ dependencies {
val zipAll = task("zipAll") {
group = "LSPosed"
}
fun afterEval() = android.applicationVariants.forEach { variant ->