OSDN Git Service

Suppress some of the Power Management debug log messages
[android-x86/system-bt.git] / build / BUILD.gn
1 #
2 #  Copyright (C) 2015 Google, Inc.
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
17 declare_args() {
18   # Include path for hardware/bluetooth.h
19   libhw_include_path = ""
20   core_include_path = ""
21 }
22
23 config("default_include_dirs") {
24   # TODO(armansito): Remove "core_include_path" once the cutils includes have
25   # been removed.
26   assert(libhw_include_path != "", "libhardware_include_path build argument wasn't provided.")
27   assert(core_include_path != "", "core_include_path build argument wasn't provided.")
28   include_dirs = [
29     libhw_include_path,
30     core_include_path,
31   ]
32 }
33
34 config("linux") {
35   # TODO(keybuk): AndroidConfig.h or equivalent
36
37   cflags = [
38     "-Wall",
39     "-Werror",
40     "-g",
41     "-O0",
42     "-fpic",
43     "-fdata-sections",
44     "-ffunction-sections",
45     "-fvisibility=hidden",
46   ]
47
48   cflags_c = [
49     "-std=c99"
50   ]
51
52   cflags_cc = [
53     "-std=c++11",
54     "-fno-exceptions",
55   ]
56
57   defines = [
58     "_FORTIFY_SOURCE=2",
59     "_GNU_SOURCE",
60     "HAS_NO_BDROID_BUILDCFG",
61     "LOG_NDEBUG=1",
62     "EXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
63
64     # This is a macro to that can be used by source code to detect if the
65     # current build is done by GN or via Android.mk. This is a temporary
66     # workaround until we can remove all Android-specific dependencies.
67     "OS_GENERIC",
68   ]
69 }
70
71 config("pic") {
72   cflags = [ "-fPIC" ]
73 }
74
75 config("gc") {
76   ldflags = [ "-Wl,--gc-sections" ]
77 }