1# binderRpcTestIface-cpp
2
3set(binderRpcTestIface-cpp_SRCS
4    BinderRpcTestClientInfo.aidl
5    BinderRpcTestServerConfig.aidl
6    BinderRpcTestServerInfo.aidl
7    IBinderRpcCallback.aidl
8    IBinderRpcSession.aidl
9    IBinderRpcTest.aidl
10    ParcelableCertificateData.aidl
11)
12
13set(binderRpcTestIface-cpp_AIDLFLAGS
14    -Weverything -Wno-missing-permission-annotation
15    -Werror
16    -Wno-mixed-oneway
17)
18
19add_aidl_library(binderRpcTestIface-cpp cpp
20    "${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/"
21    "${binderRpcTestIface-cpp_SRCS}"
22    "${binderRpcTestIface-cpp_AIDLFLAGS}")
23add_library(android::binderRpcTestIface-cpp ALIAS binderRpcTestIface-cpp)
24
25
26# binderRpcTestIface-ndk
27
28set(binderRpcTestIface-ndk_SRCS
29    BinderRpcTestClientInfo.aidl
30    BinderRpcTestServerConfig.aidl
31    BinderRpcTestServerInfo.aidl
32    IBinderRpcCallback.aidl
33    IBinderRpcSession.aidl
34    IBinderRpcTest.aidl
35    ParcelableCertificateData.aidl
36)
37
38set(binderRpcTestIface-ndk_AIDLFLAGS
39    -Weverything -Wno-missing-permission-annotation
40    -Werror
41    -Wno-mixed-oneway
42)
43
44add_aidl_library(binderRpcTestIface-ndk ndk
45    "${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/"
46    "${binderRpcTestIface-ndk_SRCS}"
47    "${binderRpcTestIface-ndk_AIDLFLAGS}")
48add_library(android::binderRpcTestIface-ndk ALIAS binderRpcTestIface-ndk)
49
50
51# binderRpcTestNoKernel
52
53set(binderRpcTestNoKernel_SRCS
54    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/binderRpcTest.cpp
55    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/binderRpcTestCommon.cpp
56    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/binderRpcUniversalTests.cpp
57)
58add_executable(binderRpcTestNoKernel ${binderRpcTestNoKernel_SRCS})
59add_test(NAME binderRpcTestNoKernel COMMAND binderRpcTestNoKernel)
60
61set(binderRpcTestNoKernel_CFLAGS
62    -DBINDER_TEST_NO_SHARED_LIBS
63    -Wall
64    -Werror
65    -Wformat
66    -Wpessimizing-move
67    -Wsign-compare
68    -Wunused-result
69    -Wzero-as-null-pointer-constant
70)
71target_compile_options(binderRpcTestNoKernel PRIVATE ${binderRpcTestNoKernel_CFLAGS})
72
73set(binderRpcTestNoKernel_DEPENDENCIES
74    GTest::gtest
75    GTest::gtest_main
76    android::binderRpcTestIface-cpp
77    android::binderRpcTestIface-ndk
78    android::libbinder_sdk
79    android::libbinder_test_utils
80    android::libbinder_tls_static
81    android::libbinder_tls_test_utils
82    android::liblog_stub
83    crypto
84    ssl
85)
86target_link_libraries(binderRpcTestNoKernel ${binderRpcTestNoKernel_DEPENDENCIES})
87
88
89# binderRpcTestSingleThreadedNoKernel
90
91set(binderRpcTestSingleThreadedNoKernel_SRCS
92    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/binderRpcTest.cpp
93    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/binderRpcTestCommon.cpp
94    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/binderRpcUniversalTests.cpp
95)
96add_executable(binderRpcTestSingleThreadedNoKernel ${binderRpcTestSingleThreadedNoKernel_SRCS})
97add_test(NAME binderRpcTestSingleThreadedNoKernel COMMAND binderRpcTestSingleThreadedNoKernel)
98
99set(binderRpcTestSingleThreadedNoKernel_CFLAGS
100    -DBINDER_TEST_NO_SHARED_LIBS
101    -Wall
102    -Werror
103    -Wformat
104    -Wpessimizing-move
105    -Wsign-compare
106    -Wunused-result
107    -Wzero-as-null-pointer-constant
108    -DBINDER_RPC_SINGLE_THREADED
109)
110target_compile_options(binderRpcTestSingleThreadedNoKernel PRIVATE ${binderRpcTestSingleThreadedNoKernel_CFLAGS})
111
112set(binderRpcTestSingleThreadedNoKernel_DEPENDENCIES
113    GTest::gtest
114    GTest::gtest_main
115    android::binderRpcTestIface-cpp
116    android::binderRpcTestIface-ndk
117    android::libbinder_ndk_sdk
118    android::libbinder_sdk_single_threaded
119    android::libbinder_test_utils
120    android::libbinder_tls_static
121    android::libbinder_tls_test_utils
122    android::liblog_stub
123    crypto
124    ssl
125)
126target_link_libraries(binderRpcTestSingleThreadedNoKernel ${binderRpcTestSingleThreadedNoKernel_DEPENDENCIES})
127
128
129# binderRpcWireProtocolTest
130
131set(binderRpcWireProtocolTest_SRCS
132    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/binderRpcWireProtocolTest.cpp
133)
134add_executable(binderRpcWireProtocolTest ${binderRpcWireProtocolTest_SRCS})
135add_test(NAME binderRpcWireProtocolTest COMMAND binderRpcWireProtocolTest)
136
137set(binderRpcWireProtocolTest_CFLAGS
138    -Wall
139    -Werror
140    -Wformat
141    -Wpessimizing-move
142    -Wsign-compare
143    -Wunused-result
144    -Wzero-as-null-pointer-constant
145)
146target_compile_options(binderRpcWireProtocolTest PRIVATE ${binderRpcWireProtocolTest_CFLAGS})
147
148set(binderRpcWireProtocolTest_DEPENDENCIES
149    GTest::gtest
150    GTest::gtest_main
151    android::libbinder_sdk
152    android::liblog_stub
153)
154target_link_libraries(binderRpcWireProtocolTest ${binderRpcWireProtocolTest_DEPENDENCIES})
155
156
157# binder_rpc_test_service_no_kernel
158
159set(binder_rpc_test_service_no_kernel_SRCS
160    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/binderRpcTestCommon.cpp
161    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/binderRpcTestService.cpp
162)
163add_executable(binder_rpc_test_service_no_kernel ${binder_rpc_test_service_no_kernel_SRCS})
164
165set(binder_rpc_test_service_no_kernel_CFLAGS
166    -DBINDER_TEST_NO_SHARED_LIBS
167    -Wall
168    -Werror
169    -Wformat
170    -Wpessimizing-move
171    -Wsign-compare
172    -Wunused-result
173    -Wzero-as-null-pointer-constant
174)
175target_compile_options(binder_rpc_test_service_no_kernel PRIVATE ${binder_rpc_test_service_no_kernel_CFLAGS})
176
177set(binder_rpc_test_service_no_kernel_DEPENDENCIES
178    android::binderRpcTestIface-cpp
179    android::binderRpcTestIface-ndk
180    android::libbinder_sdk
181    android::libbinder_test_utils
182    android::libbinder_tls_static
183    android::libbinder_tls_test_utils
184    android::liblog_stub
185    crypto
186    ssl
187)
188target_link_libraries(binder_rpc_test_service_no_kernel ${binder_rpc_test_service_no_kernel_DEPENDENCIES})
189
190
191# binder_rpc_test_service_single_threaded_no_kernel
192
193set(binder_rpc_test_service_single_threaded_no_kernel_SRCS
194    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/binderRpcTestCommon.cpp
195    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/binderRpcTestService.cpp
196)
197add_executable(binder_rpc_test_service_single_threaded_no_kernel ${binder_rpc_test_service_single_threaded_no_kernel_SRCS})
198
199set(binder_rpc_test_service_single_threaded_no_kernel_CFLAGS
200    -DBINDER_TEST_NO_SHARED_LIBS
201    -Wall
202    -Werror
203    -Wformat
204    -Wpessimizing-move
205    -Wsign-compare
206    -Wunused-result
207    -Wzero-as-null-pointer-constant
208    -DBINDER_RPC_SINGLE_THREADED
209)
210target_compile_options(binder_rpc_test_service_single_threaded_no_kernel PRIVATE ${binder_rpc_test_service_single_threaded_no_kernel_CFLAGS})
211
212set(binder_rpc_test_service_single_threaded_no_kernel_DEPENDENCIES
213    android::binderRpcTestIface-cpp
214    android::binderRpcTestIface-ndk
215    android::libbinder_ndk_sdk
216    android::libbinder_sdk_single_threaded
217    android::libbinder_test_utils
218    android::libbinder_tls_static
219    android::libbinder_tls_test_utils
220    android::liblog_stub
221    crypto
222    ssl
223)
224target_link_libraries(binder_rpc_test_service_single_threaded_no_kernel ${binder_rpc_test_service_single_threaded_no_kernel_DEPENDENCIES})
225
226
227# libbinder_test_utils
228
229set(libbinder_test_utils_SRCS
230    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/FileUtils.cpp
231)
232add_library(libbinder_test_utils ${libbinder_test_utils_SRCS})
233add_library(android::libbinder_test_utils ALIAS libbinder_test_utils)
234
235set(libbinder_test_utils_CFLAGS
236    -Wall
237    -Werror
238    -Wformat
239    -Wpessimizing-move
240    -Wsign-compare
241    -Wunused-result
242    -Wzero-as-null-pointer-constant
243)
244target_compile_options(libbinder_test_utils PRIVATE ${libbinder_test_utils_CFLAGS})
245
246set(libbinder_test_utils_DEPENDENCIES
247    android::libbinder_headers_base
248)
249target_link_libraries(libbinder_test_utils ${libbinder_test_utils_DEPENDENCIES})
250
251
252# libbinder_tls_test_utils
253
254set(libbinder_tls_test_utils_SRCS
255    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/RpcTlsTestUtils.cpp
256)
257add_library(libbinder_tls_test_utils ${libbinder_tls_test_utils_SRCS})
258add_library(android::libbinder_tls_test_utils ALIAS libbinder_tls_test_utils)
259
260set(libbinder_tls_test_utils_INCLUDES
261    ${ANDROID_BUILD_TOP}/frameworks/native/libs/binder/tests/include_tls_test_utils
262)
263target_include_directories(libbinder_tls_test_utils PUBLIC ${libbinder_tls_test_utils_INCLUDES})
264
265set(libbinder_tls_test_utils_CFLAGS
266    -Wall
267    -Werror
268    -Wformat
269    -Wpessimizing-move
270    -Wsign-compare
271    -Wunused-result
272    -Wzero-as-null-pointer-constant
273)
274target_compile_options(libbinder_tls_test_utils PRIVATE ${libbinder_tls_test_utils_CFLAGS})
275
276set(libbinder_tls_test_utils_DEPENDENCIES
277    android::libbinder_sdk
278    android::libbinder_tls_static
279    android::liblog_stub
280    crypto
281    ssl
282)
283target_link_libraries(libbinder_tls_test_utils ${libbinder_tls_test_utils_DEPENDENCIES})
284