summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreehugger Robot2016-07-11 19:10:09 -0500
committerGerrit Code Review2016-07-11 19:10:10 -0500
commitdf252716f6c49ba61b023819d7dade7081f1066c (patch)
treeb6046fc8787b969e9bdebb5946df58793dd735bd
parent3f2db32b8c2635db96feea2220fd20ca0bbe2ea6 (diff)
parentfc06bd0ca3e8262cc5f46eb97eb6bda15340f58d (diff)
downloadplatform-system-core-df252716f6c49ba61b023819d7dade7081f1066c.tar.gz
platform-system-core-df252716f6c49ba61b023819d7dade7081f1066c.tar.xz
platform-system-core-df252716f6c49ba61b023819d7dade7081f1066c.zip
Merge "Convert libbase Android.mk to Android.bp"
-rw-r--r--base/Android.bp96
-rw-r--r--base/Android.mk140
2 files changed, 96 insertions, 140 deletions
diff --git a/base/Android.bp b/base/Android.bp
new file mode 100644
index 000000000..7bf4c79a6
--- /dev/null
+++ b/base/Android.bp
@@ -0,0 +1,96 @@
1//
2// Copyright (C) 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
17libbase_cppflags = [
18 "-Wall",
19 "-Wextra",
20 "-Werror",
21]
22
23cc_library {
24 name: "libbase",
25 clang: true,
26 host_supported: true,
27 srcs: [
28 "file.cpp",
29 "logging.cpp",
30 "parsenetaddress.cpp",
31 "stringprintf.cpp",
32 "strings.cpp",
33 "test_utils.cpp",
34 ],
35 local_include_dirs: ["include"],
36 cppflags: libbase_cppflags,
37 export_include_dirs: ["include"],
38 shared_libs: ["liblog"],
39 target: {
40 android: {
41 srcs: ["errors_unix.cpp"],
42 cppflags: ["-Wexit-time-destructors"],
43 },
44 darwin: {
45 srcs: ["errors_unix.cpp"],
46 cppflags: ["-Wexit-time-destructors"],
47 },
48 linux: {
49 srcs: ["errors_unix.cpp"],
50 cppflags: ["-Wexit-time-destructors"],
51 },
52 windows: {
53 srcs: [
54 "errors_windows.cpp",
55 "utf8.cpp",
56 ],
57 enabled: true,
58 },
59 },
60}
61
62// Tests
63// ------------------------------------------------------------------------------
64cc_test {
65 name: "libbase_test",
66 host_supported: true,
67 clang: true,
68 srcs: [
69 "errors_test.cpp",
70 "file_test.cpp",
71 "logging_test.cpp",
72 "parseint_test.cpp",
73 "parsenetaddress_test.cpp",
74 "stringprintf_test.cpp",
75 "strings_test.cpp",
76 "test_main.cpp",
77 ],
78 target: {
79 windows: {
80 srcs: ["utf8_test.cpp"],
81 enabled: true,
82 },
83 },
84 local_include_dirs: ["."],
85 cppflags: libbase_cppflags,
86 shared_libs: ["libbase"],
87 compile_multilib: "both",
88 multilib: {
89 lib32: {
90 suffix: "32",
91 },
92 lib64: {
93 suffix: "64",
94 },
95 },
96}
diff --git a/base/Android.mk b/base/Android.mk
deleted file mode 100644
index 1693e7411..000000000
--- a/base/Android.mk
+++ /dev/null
@@ -1,140 +0,0 @@
1#
2# Copyright (C) 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
17LOCAL_PATH := $(call my-dir)
18
19libbase_src_files := \
20 file.cpp \
21 logging.cpp \
22 parsenetaddress.cpp \
23 stringprintf.cpp \
24 strings.cpp \
25 test_utils.cpp \
26
27libbase_linux_src_files := \
28 errors_unix.cpp \
29
30libbase_darwin_src_files := \
31 errors_unix.cpp \
32
33libbase_windows_src_files := \
34 errors_windows.cpp \
35 utf8.cpp \
36
37libbase_test_src_files := \
38 errors_test.cpp \
39 file_test.cpp \
40 logging_test.cpp \
41 parseint_test.cpp \
42 parsenetaddress_test.cpp \
43 stringprintf_test.cpp \
44 strings_test.cpp \
45 test_main.cpp \
46
47libbase_test_windows_src_files := \
48 utf8_test.cpp \
49
50libbase_cppflags := \
51 -Wall \
52 -Wextra \
53 -Werror \
54
55libbase_linux_cppflags := \
56 -Wexit-time-destructors \
57
58libbase_darwin_cppflags := \
59 -Wexit-time-destructors \
60
61# Device
62# ------------------------------------------------------------------------------
63include $(CLEAR_VARS)
64LOCAL_MODULE := libbase
65LOCAL_CLANG := true
66LOCAL_SRC_FILES := $(libbase_src_files) $(libbase_linux_src_files)
67LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
68LOCAL_CPPFLAGS := $(libbase_cppflags) $(libbase_linux_cppflags)
69LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
70LOCAL_STATIC_LIBRARIES := liblog
71LOCAL_MULTILIB := both
72include $(BUILD_STATIC_LIBRARY)
73
74include $(CLEAR_VARS)
75LOCAL_MODULE := libbase
76LOCAL_CLANG := true
77LOCAL_WHOLE_STATIC_LIBRARIES := libbase
78LOCAL_SHARED_LIBRARIES := liblog
79LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
80LOCAL_MULTILIB := both
81include $(BUILD_SHARED_LIBRARY)
82
83# Host
84# ------------------------------------------------------------------------------
85include $(CLEAR_VARS)
86LOCAL_MODULE := libbase
87LOCAL_SRC_FILES := $(libbase_src_files)
88LOCAL_SRC_FILES_darwin := $(libbase_darwin_src_files)
89LOCAL_SRC_FILES_linux := $(libbase_linux_src_files)
90LOCAL_SRC_FILES_windows := $(libbase_windows_src_files)
91LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
92LOCAL_CPPFLAGS := $(libbase_cppflags)
93LOCAL_CPPFLAGS_darwin := $(libbase_darwin_cppflags)
94LOCAL_CPPFLAGS_linux := $(libbase_linux_cppflags)
95LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
96LOCAL_STATIC_LIBRARIES := liblog
97LOCAL_MULTILIB := both
98LOCAL_MODULE_HOST_OS := darwin linux windows
99include $(BUILD_HOST_STATIC_LIBRARY)
100
101include $(CLEAR_VARS)
102LOCAL_MODULE := libbase
103LOCAL_WHOLE_STATIC_LIBRARIES := libbase
104LOCAL_SHARED_LIBRARIES := liblog
105LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
106LOCAL_MULTILIB := both
107LOCAL_MODULE_HOST_OS := darwin linux windows
108include $(BUILD_HOST_SHARED_LIBRARY)
109
110# Tests
111# ------------------------------------------------------------------------------
112include $(CLEAR_VARS)
113LOCAL_MODULE := libbase_test
114LOCAL_CLANG := true
115LOCAL_SRC_FILES := $(libbase_test_src_files)
116LOCAL_SRC_FILES_darwin := $(libbase_test_darwin_src_files)
117LOCAL_SRC_FILES_linux := $(libbase_test_linux_src_files)
118LOCAL_SRC_FILES_windows := $(libbase_test_windows_src_files)
119LOCAL_C_INCLUDES := $(LOCAL_PATH)
120LOCAL_CPPFLAGS := $(libbase_cppflags)
121LOCAL_SHARED_LIBRARIES := libbase
122LOCAL_MULTILIB := both
123LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
124LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
125include $(BUILD_NATIVE_TEST)
126
127include $(CLEAR_VARS)
128LOCAL_MODULE := libbase_test
129LOCAL_MODULE_HOST_OS := darwin linux windows
130LOCAL_SRC_FILES := $(libbase_test_src_files)
131LOCAL_SRC_FILES_darwin := $(libbase_test_darwin_src_files)
132LOCAL_SRC_FILES_linux := $(libbase_test_linux_src_files)
133LOCAL_SRC_FILES_windows := $(libbase_test_windows_src_files)
134LOCAL_C_INCLUDES := $(LOCAL_PATH)
135LOCAL_CPPFLAGS := $(libbase_cppflags)
136LOCAL_SHARED_LIBRARIES := libbase
137LOCAL_MULTILIB := both
138LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
139LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
140include $(BUILD_HOST_NATIVE_TEST)