blob: ec5e131f951d1a3ec23f0f7e2082eaddaaf42100 [file] [log] [blame]
Lloyd Pique70d91362018-10-18 16:02:55 -07001cc_defaults {
2 name: "libcompositionengine_defaults",
3 defaults: ["surfaceflinger_defaults"],
4 cflags: [
5 "-DLOG_TAG=\"CompositionEngine\"",
6 ],
Lloyd Pique441d5042018-10-18 16:49:51 -07007 shared_libs: [
8 "android.hardware.graphics.allocator@2.0",
9 "android.hardware.graphics.composer@2.1",
10 "android.hardware.graphics.composer@2.2",
11 "android.hardware.graphics.composer@2.3",
12 "android.hardware.power@1.0",
13 "android.hardware.power@1.3",
14 "libbase",
15 "libcutils",
16 "libgui",
17 "liblayers_proto",
18 "liblog",
19 "libtimestats_proto",
20 "libui",
21 "libutils",
22 ],
23 static_libs: [
24 "libmath",
25 "librenderengine",
26 "libtrace_proto",
27 ],
28 header_libs: [
29 "libsurfaceflinger_headers",
30 ],
Lloyd Pique70d91362018-10-18 16:02:55 -070031}
32
33cc_library {
34 name: "libcompositionengine",
35 defaults: ["libcompositionengine_defaults"],
36 srcs: [
37 "src/CompositionEngine.cpp",
38 ],
39 local_include_dirs: ["include"],
40 export_include_dirs: ["include"],
41}
42
43cc_library {
44 name: "libcompositionengine_mocks",
45 defaults: ["libcompositionengine_defaults"],
46 srcs: [
47 "mock/CompositionEngine.cpp",
48 ],
49 static_libs: [
50 "libgtest",
51 "libgmock",
52 "libcompositionengine",
53 ],
54 local_include_dirs: ["include"],
55 export_include_dirs: ["include"],
56}
57
58cc_test {
59 name: "libcompositionengine_test",
60 test_suites: ["device-tests"],
61 defaults: ["libcompositionengine_defaults"],
62 srcs: [
63 "tests/CompositionEngineTest.cpp",
Lloyd Pique441d5042018-10-18 16:49:51 -070064 "tests/MockHWComposer.cpp",
Lloyd Pique70d91362018-10-18 16:02:55 -070065 ],
66 static_libs: [
67 "libcompositionengine",
68 "libcompositionengine_mocks",
Lloyd Piqueb97e04f2018-10-18 17:07:05 -070069 "librenderengine_mocks",
Lloyd Pique70d91362018-10-18 16:02:55 -070070 "libgmock",
71 "libgtest",
72 ],
73 sanitize: {
74 // By using the address sanitizer, we not only uncover any issues
75 // with the test, but also any issues with the code under test.
76 //
77 // Note: If you get an runtime link error like:
78 //
79 // CANNOT LINK EXECUTABLE "/data/local/tmp/libcompositionengine_test": library "libclang_rt.asan-aarch64-android.so" not found
80 //
81 // it is because the address sanitizer shared objects are not installed
82 // by default in the system image.
83 //
84 // You can either "make dist tests" before flashing, or set this
85 // option to false temporarily.
86 address: true,
87 },
88}