blob: ebebf3d66696fe01ac2c8eaf33272b041744c555 [file] [log] [blame]
Arman Uguray9ca3fb82015-05-26 14:50:36 -07001#
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
Arman Uguraycdc6f3a2015-05-21 13:39:18 -070017config("default_include_dirs") {
Arman Uguraycdc6f3a2015-05-21 13:39:18 -070018 include_dirs = [
Jakub Pawlowskid5500192016-10-19 18:35:18 -070019 "//third_party/libhardware/include/",
Arman Uguraycdc6f3a2015-05-21 13:39:18 -070020 ]
21}
22
Scott James Remnant4c292312015-05-12 13:58:49 -070023config("linux") {
Arman Uguraycdc6f3a2015-05-21 13:39:18 -070024 # TODO(keybuk): AndroidConfig.h or equivalent
Scott James Remnant4c292312015-05-12 13:58:49 -070025
26 cflags = [
Jakub Pawlowskid7a05a02016-02-22 18:04:24 -080027 #TODO(jpawlowski): uncomment once we have no warnings on linux build
28 # "-Wall",
29 # "-Werror",
Scott James Remnant4c292312015-05-12 13:58:49 -070030 "-g",
31 "-O0",
Arman Uguraye4477782015-05-29 14:46:30 -070032 "-fpic",
33 "-fdata-sections",
34 "-ffunction-sections",
35 "-fvisibility=hidden",
Scott James Remnant4c292312015-05-12 13:58:49 -070036 ]
37
Jakub Pawlowskid7a05a02016-02-22 18:04:24 -080038 cflags_c = [ "-std=c99" ]
Scott James Remnant4c292312015-05-12 13:58:49 -070039
Arman Uguray0ca99052015-07-07 17:00:09 -070040 cflags_cc = [
Jakub Pawlowski219d4b62016-02-25 12:16:31 -080041#TODO(jpawlowski): we should use same c++ version as Android, which is c++11,
42# but we use some c++14 features. Uncomment when this get fixed in code.:
43 "-std=c++14",
Arman Uguray065d0f72015-07-16 18:12:13 -070044 "-fno-exceptions",
Jakub Pawlowski713993d2016-04-21 13:16:45 -070045 "-fpermissive",
Arman Uguray0ca99052015-07-07 17:00:09 -070046 ]
47
Scott James Remnant4c292312015-05-12 13:58:49 -070048 defines = [
49 "_FORTIFY_SOURCE=2",
50 "_GNU_SOURCE",
51 "HAS_NO_BDROID_BUILDCFG",
52 "LOG_NDEBUG=1",
Arman Uguraye4477782015-05-29 14:46:30 -070053 "EXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
Jakub Pawlowskid7a05a02016-02-22 18:04:24 -080054 "KERNEL_MISSING_CLOCK_BOOTTIME_ALARM=TRUE",
Arman Uguraycdc6f3a2015-05-21 13:39:18 -070055
Jakub Pawlowskib08fbbf2016-10-18 20:22:14 -070056 # This is a macro to that can be used by android hardware/libhardware
57 # to not include dependencies on core project. This is a temporary
58 # workaround until we get rid of dependency on hardware.
59 "_HW_DONT_INCLUDE_CORE_=1",
60
Arman Uguraycdc6f3a2015-05-21 13:39:18 -070061 # This is a macro to that can be used by source code to detect if the
62 # current build is done by GN or via Android.mk. This is a temporary
63 # workaround until we can remove all Android-specific dependencies.
64 "OS_GENERIC",
Scott James Remnant4c292312015-05-12 13:58:49 -070065 ]
66}
67
68config("pic") {
69 cflags = [ "-fPIC" ]
70}
71
72config("gc") {
73 ldflags = [ "-Wl,--gc-sections" ]
74}