Skip to content

Commit 3e74dfd

Browse files
committed
update
1 parent 2fca7ec commit 3e74dfd

4 files changed

Lines changed: 33 additions & 23 deletions

File tree

app/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ android {
2121
}
2222

2323
externalNativeBuild {
24-
ndkBuild {
25-
path "src/main/jni/Android.mk"
24+
cmake {
25+
path "src/main/jni/CMakeLists.txt"
26+
version "3.22.1"
2627
}
2728
}
2829

app/src/main/jni/Android.mk

Lines changed: 0 additions & 18 deletions
This file was deleted.

app/src/main/jni/Application.mk

Lines changed: 0 additions & 3 deletions
This file was deleted.

app/src/main/jni/CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
cmake_minimum_required(VERSION 3.22.1)
2+
3+
project("aexon_native")
4+
5+
# Flag optimasi ukuran (-Os), pembersihan unused symbols, dan penghapusan informasi debug (strip)
6+
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Os -ffunction-sections -fdata-sections")
7+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os -ffunction-sections -fdata-sections")
8+
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Wl,--gc-sections -Wl,--strip-all")
9+
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--gc-sections -Wl,--strip-all")
10+
11+
# Output binary executable dari aexon.cpp yang diberi nama libaexon.so
12+
add_executable(aexon
13+
aexon.cpp
14+
ax_loging.cpp
15+
ax_memory.cpp
16+
)
17+
set_target_properties(aexon PROPERTIES OUTPUT_NAME "libaexon.so")
18+
19+
# Target library shared native (.so)
20+
add_library(native SHARED
21+
native.cpp
22+
ax_deamon_info.cpp
23+
ax_loging.cpp
24+
ax_memory.cpp
25+
)
26+
27+
# Link library log untuk modul native
28+
find_library(log-lib log)
29+
target_link_libraries(native ${log-lib})
30+
0

0 commit comments

Comments
 (0)