blob: 922a3f62bb0feb4d3d8c6443d6a409254e7d18cc [file] [log] [blame]
Arman Uguray9ca3fb82015-05-26 14:50:36 -07001#
Jakub Pawlowski5b790fe2017-09-18 09:00:20 -07002# Copyright 2015 Google, Inc.
Arman Uguray9ca3fb82015-05-26 14:50:36 -07003#
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 Pawlowskif2f207a2017-09-23 14:47:20 -070019 "//include/",
Jakub Pawlowskid3988fd2017-07-14 21:08:47 -070020 "//types/",
Arman Uguraycdc6f3a2015-05-21 13:39:18 -070021 ]
22}
23
Scott James Remnant4c292312015-05-12 13:58:49 -070024config("linux") {
Arman Uguraycdc6f3a2015-05-21 13:39:18 -070025 # TODO(keybuk): AndroidConfig.h or equivalent
Scott James Remnant4c292312015-05-12 13:58:49 -070026
27 cflags = [
Jakub Pawlowskid7a05a02016-02-22 18:04:24 -080028 #TODO(jpawlowski): uncomment once we have no warnings on linux build
29 # "-Wall",
30 # "-Werror",
Jakub Pawlowski99e4aec2017-10-10 10:12:30 -070031 "-Wno-gnu-variable-sized-type-not-at-end",
Scott James Remnant4c292312015-05-12 13:58:49 -070032 "-g",
33 "-O0",
Arman Uguraye4477782015-05-29 14:46:30 -070034 "-fpic",
35 "-fdata-sections",
36 "-ffunction-sections",
37 "-fvisibility=hidden",
Scott James Remnant4c292312015-05-12 13:58:49 -070038 ]
39
Jakub Pawlowskid7a05a02016-02-22 18:04:24 -080040 cflags_c = [ "-std=c99" ]
Scott James Remnant4c292312015-05-12 13:58:49 -070041
Arman Uguray0ca99052015-07-07 17:00:09 -070042 cflags_cc = [
Jakub Pawlowski219d4b62016-02-25 12:16:31 -080043#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",
Arman Uguray065d0f72015-07-16 18:12:13 -070046 "-fno-exceptions",
Jakub Pawlowski713993d2016-04-21 13:16:45 -070047 "-fpermissive",
Arman Uguray0ca99052015-07-07 17:00:09 -070048 ]
49
Scott James Remnant4c292312015-05-12 13:58:49 -070050 defines = [
51 "_FORTIFY_SOURCE=2",
52 "_GNU_SOURCE",
53 "HAS_NO_BDROID_BUILDCFG",
54 "LOG_NDEBUG=1",
Arman Uguraye4477782015-05-29 14:46:30 -070055 "EXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
Jakub Pawlowskid7a05a02016-02-22 18:04:24 -080056 "KERNEL_MISSING_CLOCK_BOOTTIME_ALARM=TRUE",
Arman Uguraycdc6f3a2015-05-21 13:39:18 -070057
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",
Jakub Pawlowskic8dcd252018-10-25 15:12:43 +020062
63 "FALLTHROUGH_INTENDED",
Scott James Remnant4c292312015-05-12 13:58:49 -070064 ]
65}
66
67config("pic") {
68 cflags = [ "-fPIC" ]
69}
70
71config("gc") {
72 ldflags = [ "-Wl,--gc-sections" ]
73}