forked from lihuang1111/linux-rga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·65 lines (52 loc) · 1.67 KB
/
CMakeLists.txt
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
if(NOT CMAKE_BUILD_TYPE)
message("default to Release build for GCC builds")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif()
if(CMAKE_BUILD_TARGET STREQUAL ndk)
message("set ndk toolchain")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error -DLOG_TAG=librga")
add_compile_options(-DLINUX)
add_compile_options(-DANDROID_VNDK)
endif()
if(CMAKE_BUILD_TARGET STREQUAL buildroot)
message("set buildroot toolchain")
set(CMAKE_TOOLCHAIN_FILE
${CMAKE_SOURCE_DIR}/buildroot.cmake)
include(${CMAKE_SOURCE_DIR}/buildroot.cmake)
add_compile_options(-DLINUX)
set(CMAKE_CXX_FLAGS "-std=c++11 -O2 -pthread")
endif()
cmake_minimum_required(VERSION 2.8)
#project name
project(librga)
include_directories(
./
./include
external/libdrm
external/libdrm/include/drm
hardware/libhardware/include/hardware
hardware/libhardware/modules/gralloc
system/core/liblog/includeNDROID_NDK_REVISION_REGEX
system/core/libion/kernel-headers
)
set(IM2D_SRCS
core/RockchipRga.cpp
core/GrallocOps.cpp
core/NormalRga.cpp
core/NormalRgaApi.cpp
core/RgaUtils.cpp
im2d_api/im2d.cpp)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUN_NEED_GL")
if(CMAKE_BUILD_TARGET STREQUAL ndk)
string(REPLACE "-DANDROID" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()
add_library(rga SHARED ${IM2D_SRCS})
#build im2d test
set(IM2D_DEMO_SRCS
samples/im2d_api_demo/rgaImDemo.cpp
samples/im2d_api_demo/args.cpp)
add_executable(im2d ${IM2D_DEMO_SRCS})
target_link_libraries(im2d
rga)