1// Copyright (C) 2016 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    // See: http://go/android-license-faq
17    default_applicable_licenses: [
18        "hardware_google_graphics_common_libacryl_license",
19    ],
20}
21
22license {
23    name: "hardware_google_graphics_common_libacryl_license",
24    visibility: [":__subpackages__"],
25    license_kinds: [
26        "SPDX-license-identifier-Apache-2.0",
27    ],
28    license_text: [
29        "NOTICE",
30    ],
31}
32
33cc_library_headers {
34    name: "google_libacryl_hdrplugin_headers",
35    proprietary: true,
36    local_include_dirs: ["local_include"],
37    export_include_dirs: [
38        "hdrplugin_headers",
39        "local_include",
40    ],
41}
42
43// include_dirs is not selectable right now, change to select statement after it is supported.
44soong_config_module_type {
45    name: "libacryl_acryl_cc_defaults",
46    module_type: "cc_defaults",
47    config_namespace: "acryl",
48    value_variables: [
49        "libacryl_c_include",
50    ],
51    properties: [
52        "include_dirs",
53    ],
54}
55
56libacryl_acryl_cc_defaults {
57    name: "libacryl_include_dirs_cc_defaults",
58    soong_config_variables: {
59        libacryl_c_include: {
60            include_dirs: ["%s"],
61        },
62    },
63}
64
65cc_library_shared {
66    name: "libacryl",
67
68    cflags: [
69        "-DLOG_TAG=\"hwc-libacryl\"",
70        "-Wthread-safety",
71    ] + select(soong_config_variable("acryl", "libacryl_use_g2d_hdr_plugin"), {
72        true: ["-DLIBACRYL_G2D_HDR_PLUGIN"],
73        default: [],
74    }) + select(soong_config_variable("acryl", "libacryl_default_compositor"), {
75        any @ flag_val: ["-DLIBACRYL_DEFAULT_COMPOSITOR=\"" + flag_val + "\""],
76        default: ["-DLIBACRYL_DEFAULT_COMPOSITOR=\"no_default_compositor\""],
77    }) + select(soong_config_variable("acryl", "libacryl_default_scaler"), {
78        any @ flag_val: ["-DLIBACRYL_DEFAULT_SCALER=\"" + flag_val + "\""],
79        default: ["-DLIBACRYL_DEFAULT_SCALER=\"no_default_scaler\""],
80    }) + select(soong_config_variable("acryl", "libacryl_default_blter"), {
81        any @ flag_val: ["-DLIBACRYL_DEFAULT_BLTER=\"" + flag_val + "\""],
82        default: ["-DLIBACRYL_DEFAULT_BLTER=\"no_default_blter\""],
83    }),
84
85    shared_libs: [
86        "libcutils",
87        "libion_google",
88        "liblog",
89        "libutils",
90    ] + select(soong_config_variable("acryl", "libacryl_g2d_hdr_plugin"), {
91        any @ flag_val: [flag_val],
92        default: [],
93    }),
94
95    header_libs: [
96        "google_libacryl_hdrplugin_headers",
97        "google_hal_headers",
98        "//hardware/google/gchips/gralloc4/src:libgralloc_headers",
99    ],
100
101    local_include_dirs: [
102        "include",
103        "local_include",
104    ],
105
106    export_include_dirs: ["include"],
107
108    srcs: [
109        "acrylic.cpp",
110        "acrylic_device.cpp",
111        "acrylic_factory.cpp",
112        "acrylic_formats.cpp",
113        "acrylic_g2d.cpp",
114        "acrylic_layer.cpp",
115        "acrylic_performance.cpp",
116    ],
117
118    proprietary: true,
119
120    defaults: [
121        "android.hardware.graphics.common-ndk_shared",
122        "libacryl_include_dirs_cc_defaults",
123    ],
124}
125