1# Enable SDLLVM compiler option for build flavour >= N flavour 2PLATFORM_SDK_NPDK = 24 3ENABLE_CAM_SDLLVM := $(shell if [ $(PLATFORM_SDK_VERSION) -ge $(PLATFORM_SDK_NPDK) ] ; then echo true ; else echo false ; fi) 4ifeq ($(ENABLE_CAM_SDLLVM),true) 5SDCLANGSAVE := $(SDCLANG) 6SDCLANG := true 7endif 8 9ifneq (,$(filter $(TARGET_ARCH), arm arm64)) 10 11LOCAL_PATH:= $(call my-dir) 12 13include $(CLEAR_VARS) 14 15 16LOCAL_COPY_HEADERS_TO := qcom/camera 17LOCAL_COPY_HEADERS := QCameraFormat.h 18 19LOCAL_SRC_FILES := \ 20 util/QCameraBufferMaps.cpp \ 21 util/QCameraCmdThread.cpp \ 22 util/QCameraFlash.cpp \ 23 util/QCameraPerf.cpp \ 24 util/QCameraQueue.cpp \ 25 util/QCameraCommon.cpp \ 26 util/QCameraTrace.cpp \ 27 util/camscope_packet_type.cpp \ 28 QCamera2Hal.cpp \ 29 QCamera2Factory.cpp 30 31#HAL 3.0 source 32LOCAL_SRC_FILES += \ 33 HAL3/QCamera3HdrPlusListenerThread.cpp \ 34 HAL3/QCamera3HWI.cpp \ 35 HAL3/QCamera3Mem.cpp \ 36 HAL3/QCamera3Stream.cpp \ 37 HAL3/QCamera3Channel.cpp \ 38 HAL3/QCamera3VendorTags.cpp \ 39 HAL3/QCamera3PostProc.cpp \ 40 HAL3/QCamera3CropRegionMapper.cpp \ 41 HAL3/QCamera3StreamMem.cpp 42 43LOCAL_CFLAGS := -Wall -Wextra -Werror 44 45#HAL 1.0 source 46 47ifeq ($(TARGET_SUPPORT_HAL1),false) 48LOCAL_CFLAGS += -DQCAMERA_HAL3_SUPPORT 49else 50LOCAL_CFLAGS += -DQCAMERA_HAL1_SUPPORT 51 52# Allow implicit fallthroughs in QCamera2HWI.cpp:6495 and 53# in QCameraStateMaschine.cpp until they are fixed. 54LOCAL_CFLAGS += -Wno-implicit-fallthrough 55 56LOCAL_SRC_FILES += \ 57 HAL/QCamera2HWI.cpp \ 58 HAL/QCameraMuxer.cpp \ 59 HAL/QCameraMem.cpp \ 60 HAL/QCameraStateMachine.cpp \ 61 HAL/QCameraChannel.cpp \ 62 HAL/QCameraStream.cpp \ 63 HAL/QCameraPostProc.cpp \ 64 HAL/QCamera2HWICallbacks.cpp \ 65 HAL/QCameraParameters.cpp \ 66 HAL/QCameraParametersIntf.cpp \ 67 HAL/QCameraThermalAdapter.cpp \ 68 util/QCameraFOVControl.cpp \ 69 util/QCameraHALPP.cpp \ 70 util/QCameraDualFOVPP.cpp \ 71 util/QCameraExtZoomTranslator.cpp 72endif 73 74# System header file path prefix 75LOCAL_CFLAGS += -DSYSTEM_HEADER_PREFIX=sys 76 77LOCAL_CFLAGS += -DHAS_MULTIMEDIA_HINTS -D_ANDROID 78 79ifeq ($(TARGET_USES_AOSP),true) 80LOCAL_CFLAGS += -DVANILLA_HAL 81endif 82 83ifeq (1,$(filter 1,$(shell echo "$$(( $(PLATFORM_SDK_VERSION) <= 23 ))" ))) 84LOCAL_CFLAGS += -DUSE_HAL_3_3 85endif 86 87#use media extension 88ifeq ($(TARGET_USES_MEDIA_EXTENSIONS), true) 89LOCAL_CFLAGS += -DUSE_MEDIA_EXTENSIONS 90endif 91 92LOCAL_CFLAGS += -std=c++14 -std=gnu++1z 93#HAL 1.0 Flags 94LOCAL_CFLAGS += -DDEFAULT_DENOISE_MODE_ON -DHAL3 -DQCAMERA_REDEFINE_LOG 95 96LOCAL_C_INCLUDES := \ 97 $(LOCAL_PATH)/../mm-image-codec/qexif \ 98 $(LOCAL_PATH)/../mm-image-codec/qomx_core \ 99 $(LOCAL_PATH)/include \ 100 $(LOCAL_PATH)/stack/common \ 101 $(LOCAL_PATH)/stack/mm-camera-interface/inc \ 102 $(LOCAL_PATH)/util \ 103 $(LOCAL_PATH)/HAL3 \ 104 hardware/libhardware/include/hardware \ 105 $(SRC_MEDIA_HAL_DIR)/libstagefrighthw \ 106 $(SRC_MEDIA_HAL_DIR)/mm-core/inc \ 107 system/core/include/cutils \ 108 system/core/include/system \ 109 system/media/camera/include/system 110 111#HAL 1.0 Include paths 112LOCAL_C_INCLUDES += \ 113 $(LOCAL_PATH)/HAL 114 115ifeq ($(TARGET_COMPILE_WITH_MSM_KERNEL),true) 116LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include 117LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr 118endif 119ifeq ($(TARGET_TS_MAKEUP),true) 120LOCAL_CFLAGS += -DTARGET_TS_MAKEUP 121LOCAL_C_INCLUDES += $(LOCAL_PATH)/HAL/tsMakeuplib/include 122endif 123ifneq (,$(filter msm8974 msm8916 msm8226 msm8610 msm8916 apq8084 msm8084 msm8994 msm8992 msm8952 msm8937 msm8953 msm8996 msmcobalt sdm660 msm8998, $(TARGET_BOARD_PLATFORM))) 124 LOCAL_CFLAGS += -DVENUS_PRESENT 125endif 126 127# Disable UBWC for Easel HDR+. 128ifeq ($(TARGET_USES_EASEL), false) 129ifneq (,$(filter msm8996 msmcobalt sdm660 msm8998,$(TARGET_BOARD_PLATFORM))) 130 LOCAL_CFLAGS += -DUBWC_PRESENT 131endif 132endif 133 134ifneq (,$(filter msm8996,$(TARGET_BOARD_PLATFORM))) 135 LOCAL_CFLAGS += -DTARGET_MSM8996 136endif 137 138LOCAL_CFLAGS += -DUSE_CAMERA_METABUFFER_UTILS 139 140#LOCAL_STATIC_LIBRARIES := libqcamera2_util 141LOCAL_STATIC_LIBRARIES := android.hardware.camera.common@1.0-helper 142LOCAL_C_INCLUDES += \ 143 $(TARGET_OUT_HEADERS)/mm-core/omxcore \ 144 $(TARGET_OUT_HEADERS)/qcom/display 145LOCAL_C_INCLUDES += \ 146 $(SRC_DISPLAY_HAL_DIR)/libqservice 147LOCAL_SHARED_LIBRARIES := liblog libhardware libutils libcutils libdl libsync 148LOCAL_SHARED_LIBRARIES += libmmcamera_interface libmmjpeg_interface libui libcamera_metadata 149LOCAL_SHARED_LIBRARIES += libqdMetaData libqservice libbinder 150LOCAL_SHARED_LIBRARIES += libbase libcutils libdl libhdrplusclient 151LOCAL_SHARED_LIBRARIES += libhidlbase libutils android.hardware.power@1.2 152LOCAL_SHARED_LIBRARIES += libtinyxml2 153ifeq ($(TARGET_TS_MAKEUP),true) 154LOCAL_SHARED_LIBRARIES += libts_face_beautify_hal libts_detected_face_hal 155endif 156LOCAL_HEADER_LIBRARIES := libhardware_headers media_plugin_headers 157 158LOCAL_MODULE_RELATIVE_PATH := hw 159LOCAL_MODULE := camera.$(TARGET_BOARD_PLATFORM) 160LOCAL_VENDOR_MODULE := true 161LOCAL_MODULE_TAGS := optional 162 163LOCAL_32_BIT_ONLY := $(BOARD_QTI_CAMERA_32BIT_ONLY) 164include $(BUILD_SHARED_LIBRARY) 165 166include $(call first-makefiles-under,$(LOCAL_PATH)) 167endif 168ifeq ($(ENABLE_CAM_SDLLVM),true) 169SDCLANG := $(SDCLANGSAVE) 170endif 171