-
-
Save patm1987/1128fb1499d3fe0c23bb50a33c0e4d9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.6.0) | |
add_library(native_app_glue STATIC | |
${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c) | |
target_include_directories(native_app_glue PUBLIC | |
${ANDROID_NDK}/sources/android/native_app_glue) | |
find_library(log-lib | |
log) | |
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate") | |
add_library(helloworld-c SHARED | |
src/main/cpp/helloworld-c.cpp) | |
target_link_libraries(helloworld-c | |
android | |
native_app_glue | |
${log-lib}) |
Thanks! I originally used screencaptures for all my code snippets, and changed them to code at the last second for submission to the Android blog.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's a typo on
target_link_libraries
. It should benative_app_glue
instead ofnative_app_blue