1# Copyright 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
15LOCAL_PATH := $(call my-dir)
16
17audio_service_shared_libraries := \
18  libbinder \
19  libbinderwrapper \
20  libbrillo \
21  libbrillo-binder \
22  libc \
23  libchrome \
24  libaudioclient \
25  libutils
26
27audio_client_sources := \
28  aidl/android/brillo/brilloaudioservice/IAudioServiceCallback.aidl \
29  aidl/android/brillo/brilloaudioservice/IBrilloAudioService.aidl \
30  audio_service_callback.cpp \
31  brillo_audio_client.cpp \
32  brillo_audio_client_helpers.cpp \
33  brillo_audio_device_info.cpp \
34  brillo_audio_device_info_internal.cpp \
35  brillo_audio_manager.cpp
36
37audio_service_sources := \
38  aidl/android/brillo/brilloaudioservice/IAudioServiceCallback.aidl \
39  aidl/android/brillo/brilloaudioservice/IBrilloAudioService.aidl \
40  audio_daemon.cpp \
41  audio_device_handler.cpp \
42  audio_volume_handler.cpp \
43  brillo_audio_service_impl.cpp
44
45# Audio service.
46# =============================================================================
47include $(CLEAR_VARS)
48LOCAL_MODULE := brilloaudioservice
49LOCAL_SRC_FILES := \
50  $(audio_service_sources) \
51  main_audio_service.cpp
52LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/aidl
53LOCAL_SHARED_LIBRARIES := $(audio_service_shared_libraries)
54LOCAL_CFLAGS := -Werror -Wall
55LOCAL_INIT_RC := brilloaudioserv.rc
56include $(BUILD_EXECUTABLE)
57
58# Audio client library.
59# =============================================================================
60include $(CLEAR_VARS)
61LOCAL_MODULE := libbrilloaudio
62LOCAL_SRC_FILES := \
63  $(audio_client_sources)
64LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/aidl
65LOCAL_SHARED_LIBRARIES := $(audio_service_shared_libraries)
66LOCAL_CFLAGS := -Wall -Werror -std=c++14
67include $(BUILD_SHARED_LIBRARY)
68
69# Unit tests for the Brillo audio service.
70# =============================================================================
71include $(CLEAR_VARS)
72LOCAL_MODULE := brilloaudioservice_test
73LOCAL_SRC_FILES := \
74  $(audio_service_sources) \
75  test/audio_daemon_test.cpp \
76  test/audio_device_handler_test.cpp \
77  test/audio_volume_handler_test.cpp
78LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/aidl
79LOCAL_SHARED_LIBRARIES := \
80  $(audio_service_shared_libraries)
81LOCAL_STATIC_LIBRARIES := \
82  libBionicGtestMain \
83  libbinderwrapper_test_support \
84  libchrome_test_helpers \
85  libgmock
86LOCAL_CFLAGS := -Werror -Wall
87LOCAL_CFLAGS += -Wno-sign-compare
88include $(BUILD_NATIVE_TEST)
89
90# Unit tests for the Brillo audio client.
91# =============================================================================
92include $(CLEAR_VARS)
93LOCAL_MODULE := brilloaudioclient_test
94LOCAL_SRC_FILES := \
95  $(audio_client_sources) \
96  test/audio_service_callback_test.cpp \
97  test/brillo_audio_client_test.cpp \
98  test/brillo_audio_device_info_internal_test.cpp \
99  test/brillo_audio_manager_test.cpp
100LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/aidl
101LOCAL_SHARED_LIBRARIES := \
102  $(audio_service_shared_libraries)
103LOCAL_STATIC_LIBRARIES := \
104  libBionicGtestMain \
105  libbinderwrapper_test_support \
106  libchrome_test_helpers \
107  libgmock
108LOCAL_CFLAGS := -Wno-sign-compare -Wall -Werror
109include $(BUILD_NATIVE_TEST)
110