Skip to content

Commit

Permalink
initial simulator build
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Aug 1, 2024
1 parent b197a9f commit 74e753a
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
build
app/build
app/.cxx
.gradle/*
local.properties
# User-specific stuff
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
path = app/src/main/assets/Toolkit
url = https://github.com/Android-Boot-Manager/Toolkit
branch = master
[submodule "app/src/main/cpp/droidboot_gui"]
path = app/src/main/cpp/droidboot_gui
url = https://github.com/Android-Boot-Manager/droidboot_gui
11 changes: 11 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ android {
vectorDrawables {
useSupportLibrary = true
}
externalNativeBuild {
cmake {
cppFlags += ""
}
}
}
signingConfigs {
register("release") {
Expand Down Expand Up @@ -94,6 +99,12 @@ android {
composeOptions {
kotlinCompilerExtensionVersion = "1.1.1"
}
externalNativeBuild {
cmake {
path = file("src/main/cpp/CMakeLists.txt")
version = "3.22.1"
}
}
applicationVariants.configureEach {
tasks["merge${name.replaceFirstChar(Char::titlecase)}Assets"].dependsOn(tasks["setAssetTs"])
}
Expand Down
40 changes: 40 additions & 0 deletions app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html.
# For more examples on how to use CMake, see https://github.com/android/ndk-samples.

# Sets the minimum CMake version required for this project.
cmake_minimum_required(VERSION 3.22.1)

# Declares the project name. The project name can be accessed via ${ PROJECT_NAME},
# Since this is the top level CMakeLists.txt, the project name is also accessible
# with ${CMAKE_PROJECT_NAME} (both CMake variables are in-sync within the top level
# build script scope).
project("app")
add_subdirectory(droidboot_gui)

# Creates and names a library, sets it as either STATIC
# or SHARED, and provides the relative paths to its source code.
# You can define multiple libraries, and CMake builds them for you.
# Gradle automatically packages shared libraries with your APK.
#
# In this top level CMakeLists.txt, ${CMAKE_PROJECT_NAME} is used to define
# the target library name; in the sub-module's CMakeLists.txt, ${PROJECT_NAME}
# is preferred for the same purpose.
#
# In order to load a library into your app from Java/Kotlin, you must call
# System.loadLibrary() and pass the name of the library defined here;
# for GameActivity/NativeActivity derived applications, the same library name must be
# used in the AndroidManifest.xml file.
add_library(${CMAKE_PROJECT_NAME} SHARED
# List C/C++ source files with relative paths to this CMakeLists.txt.
app.cpp)

# Specifies libraries CMake should link to your target library. You
# can link libraries from various origins, such as libraries defined in this
# build script, prebuilt third-party libraries, or Android system libraries.
target_link_libraries(${CMAKE_PROJECT_NAME}
# List libraries link to the target library
android
log
droidboot_gui)
17 changes: 17 additions & 0 deletions app/src/main/cpp/app.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Write C++ code here.
//
// Do not forget to dynamically load the C++ library into your application.
//
// For instance,
//
// In MainActivity.java:
// static {
// System.loadLibrary("app");
// }
//
// Or, in MainActivity.kt:
// companion object {
// init {
// System.loadLibrary("app")
// }
// }
1 change: 1 addition & 0 deletions app/src/main/cpp/droidboot_gui
Submodule droidboot_gui added at 534419

0 comments on commit 74e753a

Please sign in to comment.