-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
52 lines (45 loc) · 1.49 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
#// Copyright (c) 2024-2025 Qualcomm Innovation Center, Inc. All rights reserved.
#// SPDX-License-Identifier: BSD-3-Clause-Clear
cmake_minimum_required(VERSION 3.21.1)
project(plugins)
string(TOUPPER "${CMAKE_BUILD_TARGET_ARCH}" BUILD_TARGET_ARCH)
add_definitions(-D${BUILD_TARGET_ARCH})
add_definitions(-D__LITTLE_ENDIAN)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -rdynamic -Wall")
include_directories(.)
include_directories(lib)
set(PLUGIN_SOURCES
plugin.cpp
logger/log.cpp)
if (CMAKE_BUILD_TARGET_ARCH STREQUAL "arm64")
list(APPEND PLUGIN_SOURCES
pagetable/arm/pagetable64.cpp)
elseif(CMAKE_BUILD_TARGET_ARCH STREQUAL "arm")
list(APPEND PLUGIN_SOURCES
pagetable/arm/pagetable32.cpp)
endif()
if(DEFINED BUILD_TARGET_TOGETHER)
add_definitions(-DBUILD_TARGET_TOGETHER)
list(APPEND PLUGIN_SOURCES
plugins.cpp
binder/binder.cpp
memory/cma.cpp
procrank/procrank.cpp)
add_library(plugins SHARED ${PLUGIN_SOURCES})
set_target_properties(plugins PROPERTIES PREFIX "")
else()
add_library(binder SHARED
${PLUGIN_SOURCES}
binder/binder.cpp)
set_target_properties(binder PROPERTIES PREFIX "")
add_library(cma SHARED
${PLUGIN_SOURCES}
memory/cma.cpp)
set_target_properties(cma PROPERTIES PREFIX "")
add_library(procrank SHARED
${PLUGIN_SOURCES}
procrank/procrank.cpp)
set_target_properties(procrank PROPERTIES PREFIX "")
endif()