1# 2# Copyright 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 17LOCAL_PATH := $(call my-dir) 18 19# Don't build the daemon for targets that don't contain a vendor image as 20# libsdsprpc and libadsprpc are provided by vendor code 21ifeq ($(BUILDING_VENDOR_IMAGE),true) 22 23ifeq ($(CHRE_DAEMON_ENABLED),true) 24 25include $(CLEAR_VARS) 26 27# CHRE AP-side daemon 28# NOTE: This can't be converted to a blueprint file until libsdsprpc / 29# libadsprpc is converted as blueprint targets can't depend on targets exposed 30# by makefiles 31LOCAL_MODULE := chre 32LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD 33LOCAL_LICENSE_CONDITIONS := notice 34LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE 35LOCAL_MODULE_OWNER := google 36LOCAL_MODULE_TAGS := optional 37LOCAL_VENDOR_MODULE := true 38LOCAL_INIT_RC := chre_daemon.rc 39 40LOCAL_CPP_EXTENSION := .cc 41LOCAL_CFLAGS += -Wall -Werror -Wextra 42LOCAL_CFLAGS += -DCHRE_DAEMON_METRIC_ENABLED 43 44LOCAL_TIDY_CHECKS := -google-runtime-int 45 46# Enable the LPMA feature for devices that support audio 47ifeq ($(CHRE_DAEMON_LPMA_ENABLED),true) 48LOCAL_CFLAGS += -DCHRE_DAEMON_LPMA_ENABLED 49endif 50 51ifeq ($(CHRE_DAEMON_LOAD_INTO_SENSORSPD),true) 52LOCAL_CFLAGS += -DCHRE_DAEMON_LOAD_INTO_SENSORSPD 53endif 54 55MSM_SRC_FILES := \ 56 host/common/fbs_daemon_base.cc \ 57 host/msm/daemon/fastrpc_daemon.cc \ 58 host/msm/daemon/main.cc \ 59 host/msm/daemon/generated/chre_slpi_stub.c 60 61MSM_INCLUDES := \ 62 system/chre/host/msm/daemon 63 64LOCAL_SRC_FILES := \ 65 host/common/daemon_base.cc \ 66 host/common/config_util.cc \ 67 host/common/file_stream.cc \ 68 host/common/fragmented_load_transaction.cc \ 69 host/common/host_protocol_host.cc \ 70 host/common/log_message_parser.cc \ 71 host/common/bt_snoop_log_parser.cc \ 72 host/common/socket_server.cc \ 73 host/common/st_hal_lpma_handler.cc \ 74 platform/shared/host_protocol_common.cc 75 76LOCAL_C_INCLUDES := \ 77 external/fastrpc/inc \ 78 system/chre/external/flatbuffers/include \ 79 system/chre/host/common/include \ 80 system/chre/platform/shared/include \ 81 system/chre/platform/slpi/include \ 82 system/chre/util/include \ 83 system/libbase/include \ 84 system/core/libcutils/include \ 85 system/logging/liblog/include \ 86 system/core/libutils/include 87 88LOCAL_SHARED_LIBRARIES := \ 89 libjsoncpp \ 90 libutils \ 91 libcutils \ 92 liblog \ 93 libhidlbase \ 94 libbase \ 95 android.hardware.soundtrigger@2.0 \ 96 libpower \ 97 libprotobuf-cpp-lite \ 98 chremetrics-cpp \ 99 chre_atoms_log \ 100 android.frameworks.stats-V1-ndk \ 101 libbinder_ndk 102 103LOCAL_SRC_FILES += $(MSM_SRC_FILES) 104LOCAL_C_INCLUDES += $(MSM_INCLUDES) 105 106LOCAL_CPPFLAGS += -std=c++20 107LOCAL_CFLAGS += -Wno-sign-compare 108LOCAL_CFLAGS += -Wno-c++11-narrowing 109LOCAL_CFLAGS += -Wno-deprecated-volatile 110PIGWEED_DIR = external/pigweed 111PIGWEED_DIR_RELPATH = ../../$(PIGWEED_DIR) 112LOCAL_CFLAGS += -I$(PIGWEED_DIR)/pw_bytes/public 113LOCAL_CFLAGS += -I$(PIGWEED_DIR)/pw_polyfill/public 114LOCAL_CFLAGS += -I$(PIGWEED_DIR)/pw_polyfill/public_overrides 115LOCAL_CFLAGS += -I$(PIGWEED_DIR)/pw_polyfill/standard_library_public 116LOCAL_CFLAGS += -I$(PIGWEED_DIR)/pw_preprocessor/public 117LOCAL_CFLAGS += -I$(PIGWEED_DIR)/pw_tokenizer/public 118LOCAL_CFLAGS += -I$(PIGWEED_DIR)/pw_varint/public 119LOCAL_CFLAGS += -I$(PIGWEED_DIR)/pw_span/public 120 121LOCAL_SRC_FILES += $(PIGWEED_DIR_RELPATH)/pw_tokenizer/detokenize.cc 122LOCAL_SRC_FILES += $(PIGWEED_DIR_RELPATH)/pw_tokenizer/decode.cc 123LOCAL_SRC_FILES += $(PIGWEED_DIR_RELPATH)/pw_varint/varint.cc 124 125ifeq ($(CHRE_DAEMON_USE_SDSPRPC),true) 126LOCAL_SHARED_LIBRARIES += libsdsprpc 127else 128LOCAL_SHARED_LIBRARIES += libadsprpc 129endif 130 131include $(BUILD_EXECUTABLE) 132 133endif # CHRE_DAEMON_ENABLED 134endif # BUILDING_VENDOR_IMAGE 135