-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
32 lines (26 loc) · 795 Bytes
/
CMakeLists.txt
File metadata and controls
32 lines (26 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_SYSTEM_NAME Android)
# now build app's shared lib
add_library(fbdirect SHARED
android_native_app_glue.c
fill_pixels.c)
# Export ANativeActivity_onCreate(),
# Refer to: https://github.com/android-ndk/ndk/issues/381.
set(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate"
)
find_library(android-lib-log log)
find_library(android-lib-android android)
# add lib dependencies
target_link_libraries(fbdirect
android
log
)
# optimize by default
# Quite frankly, unoptimized code is harder to read than optimized code
# The only issue with optimized code is to know where the static
# funcion code has been moved.
target_compile_options(fbdirect PRIVATE
"$<$<CONFIG:RELEASE>:-O3>"
"$<$<CONFIG:DEBUG>:-O3>"
)