1#
2# Copyright 2015 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
17webservd_root := $(my-dir)
18
19system_webservd_use_dbus := true
20system_webservd_use_binder :=
21
22# Definitions applying to all targets. $(eval) this last.
23define webservd_common
24  LOCAL_CPP_EXTENSION := .cc
25  LOCAL_CFLAGS += -Wall -Werror
26  ifeq ($(system_webservd_use_dbus),true)
27    LOCAL_CFLAGS += -DWEBSERV_USE_DBUS
28  endif
29  ifeq ($(system_webservd_use_binder),true)
30    LOCAL_CFLAGS += -DWEBSERV_USE_BINDER
31  endif
32
33  # libbrillo's secure_blob.h calls "using Blob::vector" to expose its base
34  # class's constructors. This causes a "conflicts with version inherited from
35  # 'std::__1::vector<unsigned char>'" error when building with GCC.
36  LOCAL_CLANG := true
37
38  LOCAL_C_INCLUDES += \
39    $(webservd_root) \
40    external/gtest/include \
41
42endef  # webserv_common
43
44define webservd_common_libraries
45  LOCAL_SHARED_LIBRARIES += \
46      libbrillo \
47      libbrillo-http \
48      libbrillo-stream \
49      libchrome \
50      libmicrohttpd
51
52  # TODO(wiley) Uncomment these guards once firewalld moves to binder
53  #             b/25932807
54  # ifeq ($(system_webservd_use_dbus),true)
55    LOCAL_SHARED_LIBRARIES += \
56        libbrillo-dbus \
57        libchrome-dbus \
58        libdbus
59  # endif
60  ifeq ($(system_webservd_use_binder),true)
61    LOCAL_SHARED_LIBRARIES += \
62        libbrillo-binder \
63        libcutils \
64        libutils \
65        libbinder
66  endif
67
68endef  # webserv_common_libraries
69
70include $(call all-subdir-makefiles)
71