Skip to content

Commit

Permalink
Build for Android using NDK
Browse files Browse the repository at this point in the history
  • Loading branch information
thecaptury committed Jan 19, 2023
1 parent 3e18c96 commit da23d9d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
LOCAL_PATH := $(call my-dir)

# build RemoteCaptury
include $(CLEAR_VARS)
LOCAL_MODULE := RemoteCaptury
LOCAL_SRC_FILES := ${CMAKE_CURRENT_SOURCE_DIR}/RemoteCaptury.cpp
LOCAL_C_INCLUDES := ${CMAKE_SOURCE_DIR}/lib/include
include $(BUILD_SHARED_LIBRARY)
3 changes: 3 additions & 0 deletions Application.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
APP_STL := c++_static
APP_DEBUG := true

9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,12 @@ if (TARGET Python3::Python)
)
endif (WIN32)
endif (TARGET Python3::Python)

if (ANDROID_NDK_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Android.mk jni/Android.mk)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Application.mk jni/Application.mk)
add_custom_target(RemoteCapturyAndroid
COMMAND ${CMAKE_COMMAND} -E env NDK_LIBS_OUT=${CMAKE_CURRENT_BINARY_DIR} ${ANDROID_NDK_BUILD}
DEPENDS RemoteCaptury.cpp RemoteCaptury.h
)
endif(ANDROID_NDK_FOUND)

0 comments on commit da23d9d

Please sign in to comment.