Arman Uguray | 9ca3fb8 | 2015-05-26 14:50:36 -0700 | [diff] [blame] | 1 | # |
Jakub Pawlowski | 5b790fe | 2017-09-18 09:00:20 -0700 | [diff] [blame] | 2 | # Copyright 2015 Google, Inc. |
Arman Uguray | 9ca3fb8 | 2015-05-26 14:50:36 -0700 | [diff] [blame] | 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 Uguray | cdc6f3a | 2015-05-21 13:39:18 -0700 | [diff] [blame] | 17 | config("default_include_dirs") { |
Arman Uguray | cdc6f3a | 2015-05-21 13:39:18 -0700 | [diff] [blame] | 18 | include_dirs = [ |
Jakub Pawlowski | f2f207a | 2017-09-23 14:47:20 -0700 | [diff] [blame] | 19 | "//include/", |
Jakub Pawlowski | d3988fd | 2017-07-14 21:08:47 -0700 | [diff] [blame] | 20 | "//types/", |
Arman Uguray | cdc6f3a | 2015-05-21 13:39:18 -0700 | [diff] [blame] | 21 | ] |
| 22 | } |
| 23 | |
Scott James Remnant | 4c29231 | 2015-05-12 13:58:49 -0700 | [diff] [blame] | 24 | config("linux") { |
Arman Uguray | cdc6f3a | 2015-05-21 13:39:18 -0700 | [diff] [blame] | 25 | # TODO(keybuk): AndroidConfig.h or equivalent |
Scott James Remnant | 4c29231 | 2015-05-12 13:58:49 -0700 | [diff] [blame] | 26 | |
| 27 | cflags = [ |
Jakub Pawlowski | d7a05a0 | 2016-02-22 18:04:24 -0800 | [diff] [blame] | 28 | #TODO(jpawlowski): uncomment once we have no warnings on linux build |
| 29 | # "-Wall", |
| 30 | # "-Werror", |
Jakub Pawlowski | 99e4aec | 2017-10-10 10:12:30 -0700 | [diff] [blame] | 31 | "-Wno-gnu-variable-sized-type-not-at-end", |
Scott James Remnant | 4c29231 | 2015-05-12 13:58:49 -0700 | [diff] [blame] | 32 | "-g", |
| 33 | "-O0", |
Arman Uguray | e447778 | 2015-05-29 14:46:30 -0700 | [diff] [blame] | 34 | "-fpic", |
| 35 | "-fdata-sections", |
| 36 | "-ffunction-sections", |
| 37 | "-fvisibility=hidden", |
Scott James Remnant | 4c29231 | 2015-05-12 13:58:49 -0700 | [diff] [blame] | 38 | ] |
| 39 | |
Jakub Pawlowski | d7a05a0 | 2016-02-22 18:04:24 -0800 | [diff] [blame] | 40 | cflags_c = [ "-std=c99" ] |
Scott James Remnant | 4c29231 | 2015-05-12 13:58:49 -0700 | [diff] [blame] | 41 | |
Arman Uguray | 0ca9905 | 2015-07-07 17:00:09 -0700 | [diff] [blame] | 42 | cflags_cc = [ |
Jakub Pawlowski | 219d4b6 | 2016-02-25 12:16:31 -0800 | [diff] [blame] | 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", |
Arman Uguray | 065d0f7 | 2015-07-16 18:12:13 -0700 | [diff] [blame] | 46 | "-fno-exceptions", |
Jakub Pawlowski | 713993d | 2016-04-21 13:16:45 -0700 | [diff] [blame] | 47 | "-fpermissive", |
Arman Uguray | 0ca9905 | 2015-07-07 17:00:09 -0700 | [diff] [blame] | 48 | ] |
| 49 | |
Scott James Remnant | 4c29231 | 2015-05-12 13:58:49 -0700 | [diff] [blame] | 50 | defines = [ |
| 51 | "_FORTIFY_SOURCE=2", |
| 52 | "_GNU_SOURCE", |
| 53 | "HAS_NO_BDROID_BUILDCFG", |
| 54 | "LOG_NDEBUG=1", |
Arman Uguray | e447778 | 2015-05-29 14:46:30 -0700 | [diff] [blame] | 55 | "EXPORT_SYMBOL=__attribute__((visibility(\"default\")))", |
Jakub Pawlowski | d7a05a0 | 2016-02-22 18:04:24 -0800 | [diff] [blame] | 56 | "KERNEL_MISSING_CLOCK_BOOTTIME_ALARM=TRUE", |
Arman Uguray | cdc6f3a | 2015-05-21 13:39:18 -0700 | [diff] [blame] | 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", |
Jakub Pawlowski | c8dcd25 | 2018-10-25 15:12:43 +0200 | [diff] [blame] | 62 | |
| 63 | "FALLTHROUGH_INTENDED", |
Scott James Remnant | 4c29231 | 2015-05-12 13:58:49 -0700 | [diff] [blame] | 64 | ] |
| 65 | } |
| 66 | |
| 67 | config("pic") { |
| 68 | cflags = [ "-fPIC" ] |
| 69 | } |
| 70 | |
| 71 | config("gc") { |
| 72 | ldflags = [ "-Wl,--gc-sections" ] |
| 73 | } |