1# libbinder_headers_base
2
3add_library(libbinder_headers_base INTERFACE)
4add_library(android::libbinder_headers_base ALIAS libbinder_headers_base)
5
6set(libbinder_headers_base_INCLUDES
7    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/include
8)
9target_include_directories(libbinder_headers_base INTERFACE ${libbinder_headers_base_INCLUDES})
10
11set(libbinder_headers_base_DEPENDENCIES
12    android::libbinder_headers_platform_shared
13)
14target_link_libraries(libbinder_headers_base INTERFACE ${libbinder_headers_base_DEPENDENCIES})
15
16
17# libbinder_sdk
18
19set(libbinder_sdk_SRCS
20    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/Binder.cpp
21    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/BpBinder.cpp
22    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/Debug.cpp
23    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/FdTrigger.cpp
24    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/IInterface.cpp
25    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/IResultReceiver.cpp
26    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/Parcel.cpp
27    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/ParcelFileDescriptor.cpp
28    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/RecordedTransaction.cpp
29    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/RpcSession.cpp
30    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/RpcServer.cpp
31    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/RpcState.cpp
32    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/RpcTransportRaw.cpp
33    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/Stability.cpp
34    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/Status.cpp
35    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/TextOutput.cpp
36    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/Utils.cpp
37    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/file.cpp
38    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/OS_non_android_linux.cpp
39    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/OS_unix_base.cpp
40)
41add_library(libbinder_sdk ${libbinder_sdk_SRCS})
42add_library(android::libbinder_sdk ALIAS libbinder_sdk)
43
44set(libbinder_sdk_CFLAGS
45    -DBINDER_ENABLE_LIBLOG_ASSERT
46    -DBINDER_DISABLE_NATIVE_HANDLE
47    -DBINDER_DISABLE_BLOB
48    -DBINDER_NO_LIBBASE
49    -Wextra
50    -Wextra-semi
51    -Werror
52    -Wzero-as-null-pointer-constant
53    -DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION
54    -DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION
55    -fvisibility=hidden
56    -DBUILDING_LIBBINDER
57)
58append_cxx_flags_if_supported(libbinder_sdk_CFLAGS
59    -Wreorder-init-list
60)
61target_compile_options(libbinder_sdk PRIVATE ${libbinder_sdk_CFLAGS})
62
63set(libbinder_sdk_DEPENDENCIES
64    android::libbinder_headers_base
65    android::liblog_stub
66    android::libutils_binder_sdk
67)
68target_link_libraries(libbinder_sdk ${libbinder_sdk_DEPENDENCIES})
69
70
71# libbinder_sdk_single_threaded
72
73set(libbinder_sdk_single_threaded_SRCS
74    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/Binder.cpp
75    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/BpBinder.cpp
76    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/Debug.cpp
77    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/FdTrigger.cpp
78    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/IInterface.cpp
79    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/IResultReceiver.cpp
80    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/Parcel.cpp
81    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/ParcelFileDescriptor.cpp
82    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/RecordedTransaction.cpp
83    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/RpcSession.cpp
84    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/RpcServer.cpp
85    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/RpcState.cpp
86    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/RpcTransportRaw.cpp
87    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/Stability.cpp
88    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/Status.cpp
89    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/TextOutput.cpp
90    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/Utils.cpp
91    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/file.cpp
92    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/OS_non_android_linux.cpp
93    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/OS_unix_base.cpp
94)
95add_library(libbinder_sdk_single_threaded ${libbinder_sdk_single_threaded_SRCS})
96add_library(android::libbinder_sdk_single_threaded ALIAS libbinder_sdk_single_threaded)
97
98set(libbinder_sdk_single_threaded_CFLAGS
99    -DBINDER_ENABLE_LIBLOG_ASSERT
100    -DBINDER_DISABLE_NATIVE_HANDLE
101    -DBINDER_DISABLE_BLOB
102    -DBINDER_NO_LIBBASE
103    -Wextra
104    -Wextra-semi
105    -Werror
106    -Wzero-as-null-pointer-constant
107    -DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION
108    -DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION
109    -fvisibility=hidden
110    -DBUILDING_LIBBINDER
111    -DBINDER_RPC_SINGLE_THREADED
112)
113append_cxx_flags_if_supported(libbinder_sdk_single_threaded_CFLAGS
114    -Wreorder-init-list
115)
116target_compile_options(libbinder_sdk_single_threaded PRIVATE ${libbinder_sdk_single_threaded_CFLAGS})
117
118set(libbinder_sdk_single_threaded_DEPENDENCIES
119    android::libbinder_headers_base
120    android::liblog_stub
121    android::libutils_binder_sdk
122)
123target_link_libraries(libbinder_sdk_single_threaded ${libbinder_sdk_single_threaded_DEPENDENCIES})
124
125
126# libbinder_tls_static
127
128set(libbinder_tls_static_SRCS
129    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/RpcTransportTls.cpp
130    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/RpcTlsUtils.cpp
131)
132add_library(libbinder_tls_static ${libbinder_tls_static_SRCS})
133add_library(android::libbinder_tls_static ALIAS libbinder_tls_static)
134
135set(libbinder_tls_static_INCLUDES
136    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/include_tls
137)
138target_include_directories(libbinder_tls_static PUBLIC ${libbinder_tls_static_INCLUDES})
139
140set(libbinder_tls_static_DEPENDENCIES
141    android::libbinder_headers_base
142    android::libbinder_sdk
143    android::liblog_stub
144    crypto
145    ssl
146)
147target_link_libraries(libbinder_tls_static ${libbinder_tls_static_DEPENDENCIES})
148