1/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package {
18    // See: http://go/android-license-faq
19    // A large-scale-change added 'default_applicable_licenses' to import
20    // all of the 'license_kinds' from "hardware_google_camera_license"
21    // to get the below license kinds:
22    //   SPDX-license-identifier-Apache-2.0
23    default_applicable_licenses: ["hardware_google_camera_license"],
24}
25
26soong_config_module_type_import {
27    from: "hardware/google/camera/common/hal/Android.bp",
28    module_types: ["gch_hal_cc_defaults"],
29}
30
31gch_hal_cc_defaults {
32    name: "gch_hwl_linking_cc_defaults",
33    soong_config_variables: {
34        hwl_library: {
35            lyric: {
36                shared_libs: ["//vendor/google/services/LyricCameraHAL/src:liblyric_hwl"],
37            },
38            conditions_default: {
39                cflags: ["-DGCH_HWL_USE_DLOPEN=1"],
40            },
41        },
42    },
43}
44
45cc_library_shared {
46    name: "libgooglecamerahal",
47    defaults: [
48        "google_camera_hal_defaults",
49        "gch_hwl_linking_cc_defaults",
50    ],
51    owner: "google",
52    vendor: true,
53    compile_multilib: "first",
54    ldflags: [
55        "-Wl,--rpath,/system/${LIB}/camera/capture_sessions",
56        "-Wl,--rpath,/vendor/${LIB}/camera/capture_sessions",
57    ],
58    srcs: [
59        "basic_capture_session.cc",
60        "basic_request_processor.cc",
61        "basic_result_processor.cc",
62        "camera_device.cc",
63        "camera_device_session.cc",
64        "camera_provider.cc",
65        "capture_session_utils.cc",
66        "capture_session_wrapper_process_block.cc",
67        "depth_process_block.cc",
68        "dual_ir_capture_session.cc",
69        "dual_ir_depth_result_processor.cc",
70        "dual_ir_request_processor.cc",
71        "dual_ir_result_request_processor.cc",
72        "hdrplus_capture_session.cc",
73        "pending_requests_tracker.cc",
74        "realtime_process_block.cc",
75        "realtime_zsl_request_processor.cc",
76        "realtime_zsl_result_processor.cc",
77        "rgbird_capture_session.cc",
78        "rgbird_depth_result_processor.cc",
79        "rgbird_result_request_processor.cc",
80        "rgbird_rt_request_processor.cc",
81        "snapshot_request_processor.cc",
82        "snapshot_result_processor.cc",
83        "vendor_tags.cc",
84        "zsl_snapshot_capture_session.cc",
85    ],
86    shared_libs: [
87        "android.hardware.graphics.mapper@2.0",
88        "android.hardware.graphics.mapper@3.0",
89        "android.hardware.graphics.mapper@4.0",
90        "lib_profiler",
91        "libbase",
92        "libcamera_metadata",
93        "libcutils",
94        "libgooglecamerahalutils",
95        "libhidlbase",
96        "liblog",
97        "libmeminfo",
98        "libutils",
99        "libsync",
100    ],
101    header_libs: [
102        "lib_depth_generator_headers",
103    ],
104    // b/129863492, clang-tidy nondeterministic seg fault
105    tidy: false,
106    export_include_dirs: [
107        ".",
108    ],
109    export_header_lib_headers: [
110        "libgooglecamerahal_headers",
111    ],
112    export_shared_lib_headers: [
113        "lib_profiler",
114    ],
115}
116