diff --git a/.gitignore b/.gitignore index e4efb646..356ae769 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,11 @@ /.idea .DS_Store /build +.cxx +CMakeCache.txt +CMakeFiles +CMakeLists.txt +ThirdPartyTlsLibrary /app/app.iml /app/.externalNativeBuild /app/.cxx diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..a009737a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "katago"] + path = engine/katago/src + url = https://github.com/lightvector/KataGo diff --git a/engine/katago/build.gradle.kts b/engine/katago/build.gradle.kts new file mode 100644 index 00000000..90de8bf1 --- /dev/null +++ b/engine/katago/build.gradle.kts @@ -0,0 +1,50 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "io.zenandroid.onlinego.engine.katago" + compileSdk = 34 + + defaultConfig { + minSdk = 21 + + externalNativeBuild { + cmake { + arguments( + "-DUSE_BACKEND=EIGEN", + "-DANDROID_ARM_NEON=TRUE", + "-DEigen3_DIR=/usr/share/eigen3/cmake/", + ) + cFlags("-fexceptions", "-frtti") + cppFlags( + "-D__STDC_FORMAT_MACROS", + "-DBYTE_ORDER=LITTLE_ENDIAN") + } + } + } + + buildTypes { + release { + isMinifyEnabled = false + } + } + externalNativeBuild { + cmake { + path("src/cpp/CMakeLists.txt") + version = "3.22.1" + buildStagingDirectory = file("${buildDir}/bin") + } + } +} + +dependencies { + //implementation("androidx.core:core-ktx:1.9.0") + //implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) + //implementation("androidx.appcompat:appcompat:1.6.1") + //implementation("com.google.android.material:material:1.10.0") + //testImplementation("junit:junit:4.13.2") + //androidTestImplementation("androidx.test.ext:junit:1.1.5") + //androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") +} diff --git a/engine/katago/src b/engine/katago/src new file mode 160000 index 00000000..de465b1a --- /dev/null +++ b/engine/katago/src @@ -0,0 +1 @@ +Subproject commit de465b1abaf0fc536612aeb5e236582597eee63d diff --git a/settings.gradle b/settings.gradle index e7b4def4..9f30807f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,2 @@ include ':app' +include ':engine:katago'