Home | History | Annotate | Download | only in build
      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 
     17 config("default_include_dirs") {
     18   include_dirs = [
     19     "//third_party/libhardware/include/",
     20   ]
     21 }
     22 
     23 config("linux") {
     24   # TODO(keybuk): AndroidConfig.h or equivalent
     25 
     26   cflags = [
     27     #TODO(jpawlowski): uncomment once we have no warnings on linux build
     28     #    "-Wall",
     29     #    "-Werror",
     30     "-g",
     31     "-O0",
     32     "-fpic",
     33     "-fdata-sections",
     34     "-ffunction-sections",
     35     "-fvisibility=hidden",
     36   ]
     37 
     38   cflags_c = [ "-std=c99" ]
     39 
     40   cflags_cc = [
     41 #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",
     44     "-fno-exceptions",
     45     "-fpermissive",
     46   ]
     47 
     48   defines = [
     49     "_FORTIFY_SOURCE=2",
     50     "_GNU_SOURCE",
     51     "HAS_NO_BDROID_BUILDCFG",
     52     "LOG_NDEBUG=1",
     53     "EXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
     54     "KERNEL_MISSING_CLOCK_BOOTTIME_ALARM=TRUE",
     55 
     56     # 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 
     61     # 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",
     65   ]
     66 }
     67 
     68 config("pic") {
     69   cflags = [ "-fPIC" ]
     70 }
     71 
     72 config("gc") {
     73   ldflags = [ "-Wl,--gc-sections" ]
     74 }
     75