-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
35 lines (29 loc) · 1 KB
/
CMakeLists.txt
File metadata and controls
35 lines (29 loc) · 1 KB
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
cmake_minimum_required(VERSION 3.22.1)
include(ndk.cmake)
project(adbex C)
# LTO
cmake_policy(SET CMP0069 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
include(CheckIPOSupported)
check_ipo_supported(RESULT ipo_supported OUTPUT ipo_supported_output)
if (ipo_supported)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
else ()
message(WARNING "IPO is not supported: ${ipo_supported_output}")
endif ()
# Global options
set(CMAKE_C_VISIBILITY_PRESET hidden)
add_compile_options($<$<CONFIG:RELEASE>:-Os>)
add_link_options($<$<CONFIG:RELEASE>:-s>)
# plthook
set(PLTHOOK_PATH external/plthook)
set(PLTHOOK_SRC ${PLTHOOK_PATH}/plthook_elf.c)
add_library(plthook STATIC ${PLTHOOK_SRC})
target_include_directories(plthook SYSTEM PUBLIC ${PLTHOOK_PATH})
# adbex
add_executable(inject inject.c ptrace.c utils.c)
target_link_libraries(inject)
add_library(adbex_init SHARED adbex_init.c utils.c)
target_link_libraries(adbex_init plthook)
add_library(adbex_adbd SHARED adbex_adbd.c utils.c)
target_link_libraries(adbex_adbd)