blob: 999d6b428f53d887b81e4328488c29244a5ccfc2 [file] [log] [blame]
Daniel Erat35f65872015-08-17 20:59:29 -06001#
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
Christopher Wileyff0ff952016-01-04 13:11:36 -080019system_webservd_use_dbus := true
20system_webservd_use_binder :=
21
Daniel Erat35f65872015-08-17 20:59:29 -060022# Definitions applying to all targets. $(eval) this last.
23define webservd_common
24 LOCAL_CPP_EXTENSION := .cc
Christopher Wiley016df0a2016-01-04 08:41:41 -080025 LOCAL_CFLAGS += -Wall -Werror
Christopher Wileyff0ff952016-01-04 13:11:36 -080026 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
Daniel Erat35f65872015-08-17 20:59:29 -060032
Alex Vakulenko7dee8db2015-10-27 11:47:54 -070033 # libbrillo's secure_blob.h calls "using Blob::vector" to expose its base
Daniel Erat35f65872015-08-17 20:59:29 -060034 # 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
Daniel Erat35f65872015-08-17 20:59:29 -060038 LOCAL_C_INCLUDES += \
39 $(webservd_root) \
Daniel Erat35f65872015-08-17 20:59:29 -060040 external/gtest/include \
41
Christopher Wileyff0ff952016-01-04 13:11:36 -080042endef # webserv_common
43
44define webservd_common_libraries
Daniel Erat35f65872015-08-17 20:59:29 -060045 LOCAL_SHARED_LIBRARIES += \
Alex Vakulenko7dee8db2015-10-27 11:47:54 -070046 libbrillo \
Alex Vakulenko7dee8db2015-10-27 11:47:54 -070047 libbrillo-http \
48 libbrillo-stream \
Daniel Erat35f65872015-08-17 20:59:29 -060049 libchrome \
Christopher Wileyff0ff952016-01-04 13:11:36 -080050 libmicrohttpd
Daniel Erat35f65872015-08-17 20:59:29 -060051
Christopher Wileyff0ff952016-01-04 13:11:36 -080052 # 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
Daniel Erat35f65872015-08-17 20:59:29 -060069
70include $(call all-subdir-makefiles)