-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
36 lines (30 loc) · 1.6 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
cmake_minimum_required (VERSION 3.1)
project(hybris LANGUAGES C ASM)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
set(HYBRIS_SOURCES src/cache.c src/dlfcn.c src/hooks.c src/hooks_shm.c src/logging.c src/properties.c src/ctype.c src/sysconf.c src/jb/dlfcn.c src/jb/linker.c src/jb/linker_environ.c src/jb/linker_format.c src/jb/rt.c src/hooks_pthread.c src/hooks_dirent.c src/hooks_io.c src/hooks_net.c src/hooks_list.c)
set(HYBRIS_EXTRA_DEFS )
if(APPLE)
set(HYBRIS_SOURCES ${HYBRIS_SOURCES} src/hooks_net_darwin.c src/hooks_darwin_pthread_once.cpp)
set(HYBRIS_SOURCES ${HYBRIS_SOURCES} src/bionic/arch-x86/setjmp.S src/bionic/setjmp_cookie.c)
set(HYBRIS_EXTRA_DEFS ${HYBRIS_EXTRA_DEFS} USE_BIONIC_SETJMP)
else()
set(HYBRIS_SOURCES ${HYBRIS_SOURCES} src/strlcpy.c src/hooks_list.c src/hooks_list.h)
endif()
add_library(hybris ${HYBRIS_SOURCES})
target_include_directories(hybris PUBLIC include/)
target_link_libraries(hybris Threads::Threads)
target_compile_definitions(hybris PRIVATE ${HYBRIS_EXTRA_DEFS})
if (${IS_ARM_BUILD})
target_compile_definitions(hybris PRIVATE HAVE_ARM_TLS_REGISTER ANDROID_ARM_LINKER _GNU_SOURCE LINKER_TEXT_BASE=0xB0000100 LINKER_AREA_SIZE=0x01000000 LINKER_DEBUG=1)
if (${IS_ARMHF_BUILD})
target_compile_definitions(hybris PRIVATE AVOID_FLOAT_POINT_HOOKS)
endif()
else()
target_compile_definitions(hybris PRIVATE ANDROID_X86_LINKER _GNU_SOURCE LINKER_TEXT_BASE=0xB0000100 LINKER_AREA_SIZE=0x01000000 LINKER_DEBUG=1)
endif()
if(APPLE)
target_link_libraries(hybris epoll-shim osx-elf-header)
else()
target_link_libraries(hybris rt)
endif()