Arman Uguray | 9ca3fb8 | 2015-05-26 14:50:36 -0700 | [diff] [blame] | 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 | |
Arman Uguray | cdc6f3a | 2015-05-21 13:39:18 -0700 | [diff] [blame] | 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 | |
Scott James Remnant | 4c29231 | 2015-05-12 13:58:49 -0700 | [diff] [blame] | 34 | config("linux") { |
Arman Uguray | cdc6f3a | 2015-05-21 13:39:18 -0700 | [diff] [blame] | 35 | # TODO(keybuk): AndroidConfig.h or equivalent |
Scott James Remnant | 4c29231 | 2015-05-12 13:58:49 -0700 | [diff] [blame] | 36 | |
| 37 | cflags = [ |
| 38 | "-Wall", |
| 39 | "-Werror", |
| 40 | "-g", |
| 41 | "-O0", |
Arman Uguray | e447778 | 2015-05-29 14:46:30 -0700 | [diff] [blame^] | 42 | "-fpic", |
| 43 | "-fdata-sections", |
| 44 | "-ffunction-sections", |
| 45 | "-fvisibility=hidden", |
Scott James Remnant | 4c29231 | 2015-05-12 13:58:49 -0700 | [diff] [blame] | 46 | ] |
| 47 | |
| 48 | cflags_c = [ |
| 49 | "-std=c99" |
| 50 | ] |
| 51 | |
| 52 | defines = [ |
| 53 | "_FORTIFY_SOURCE=2", |
| 54 | "_GNU_SOURCE", |
| 55 | "HAS_NO_BDROID_BUILDCFG", |
| 56 | "LOG_NDEBUG=1", |
Arman Uguray | e447778 | 2015-05-29 14:46:30 -0700 | [diff] [blame^] | 57 | "EXPORT_SYMBOL=__attribute__((visibility(\"default\")))", |
Arman Uguray | cdc6f3a | 2015-05-21 13:39:18 -0700 | [diff] [blame] | 58 | |
| 59 | # This is a macro to that can be used by source code to detect if the |
| 60 | # current build is done by GN or via Android.mk. This is a temporary |
| 61 | # workaround until we can remove all Android-specific dependencies. |
| 62 | "OS_GENERIC", |
Scott James Remnant | 4c29231 | 2015-05-12 13:58:49 -0700 | [diff] [blame] | 63 | ] |
| 64 | } |
| 65 | |
| 66 | config("pic") { |
| 67 | cflags = [ "-fPIC" ] |
| 68 | } |
| 69 | |
| 70 | config("gc") { |
| 71 | ldflags = [ "-Wl,--gc-sections" ] |
| 72 | } |