1#
2#  Copyright 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
17config("default_include_dirs") {
18  include_dirs = [
19    "//include/",
20    "//types/",
21  ]
22}
23
24config("linux") {
25  # TODO(keybuk): AndroidConfig.h or equivalent
26
27  cflags = [
28    #TODO(jpawlowski): uncomment once we have no warnings on linux build
29    #    "-Wall",
30    #    "-Werror",
31    "-Wno-gnu-variable-sized-type-not-at-end",
32    "-g",
33    "-O0",
34    "-fpic",
35    "-fdata-sections",
36    "-ffunction-sections",
37    "-fvisibility=hidden",
38  ]
39
40  cflags_c = [ "-std=c99" ]
41
42  cflags_cc = [
43#TODO(jpawlowski): we should use same c++ version as Android, which is c++11,
44# but we use some c++14 features. Uncomment when this get fixed in code.:
45    "-std=c++14",
46    "-fno-exceptions",
47    "-fpermissive",
48  ]
49
50  defines = [
51    "_FORTIFY_SOURCE=2",
52    "_GNU_SOURCE",
53    "HAS_NO_BDROID_BUILDCFG",
54    "LOG_NDEBUG=1",
55    "EXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
56    "KERNEL_MISSING_CLOCK_BOOTTIME_ALARM=TRUE",
57
58    # This is a macro to that can be used by source code to detect if the
59    # current build is done by GN or via Android.mk. This is a temporary
60    # workaround until we can remove all Android-specific dependencies.
61    "OS_GENERIC",
62  ]
63}
64
65config("pic") {
66  cflags = [ "-fPIC" ]
67}
68
69config("gc") {
70  ldflags = [ "-Wl,--gc-sections" ]
71}
72