Home | History | Annotate | Download | only in Source
      1 # Copyright 2014 The Chromium Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 import("config.gni")
      6 if (is_clang) {
      7   import("//build/config/clang/clang.gni")
      8 }
      9 
     10 visibility = [ "//third_party/WebKit/*" ]
     11 
     12 # features ---------------------------------------------------------------------
     13 
     14 config("features") {
     15   defines = feature_defines_list
     16 }
     17 
     18 # inside_blink -----------------------------------------------------------------
     19 
     20 config("inside_blink") {
     21   defines = [
     22     "BLINK_IMPLEMENTATION=1",
     23     "INSIDE_BLINK",
     24   ]
     25 }
     26 
     27 # config -----------------------------------------------------------------------
     28 
     29 config("config") {
     30   include_dirs = [ ".", ".." ]
     31 
     32   cflags = []
     33   defines = []
     34 
     35   if (is_win) {
     36     cflags += [
     37       "/wd4305",  # Truncation from 'type1' to 'type2'.
     38       "/wd4324",  # Struct padded due to declspec(align).
     39       "/wd4714",  # Function marked forceinline not inlined.
     40       "/wd4800",  # Value forced to bool.
     41       "/wd4996",  # Deprecated function call.
     42     ]
     43   }
     44 
     45   if (is_win) {
     46     if (component_mode == "shared_library") {
     47       defines += [ "USING_V8_SHARED" ]
     48     }
     49   } else {  # ! Windows
     50     # TODO(GYP) this should be based on gcc_version >= 46 but GN doesn't have a
     51     # concept of GCC version yet.
     52 
     53     # Disable warnings about c++0x compatibility, as some names (such as
     54     # nullptr) conflict with upcoming c++0x types.
     55     cflags_cc = [ "-Wno-c++0x-compat" ]
     56   }
     57 
     58   if (is_linux && cpu_arch == "arm") {
     59     # Due to a bug in gcc arm, we get warnings about uninitialized
     60     # timesNewRoman.unstatic.3258 and colorTransparent.unstatic.4879.
     61     cflags += [ "-Wno-uninitialized" ]
     62   }
     63 
     64   if (is_clang) {
     65     if (blink_gc_plugin && clang_use_chrome_plugins) {
     66       # TODO(GYP)
     67       #'cflags': ['<!@(../../../tools/clang/scripts/blink_gc_plugin_flags.sh enable-oilpan=<(enable_oilpan) dump-graph=<(blink_gc_plugin_dump_graph))'],
     68     }
     69   }
     70 }
     71 
     72 # The follow configs apply to all targets except for unit tests, which rely on
     73 # static initializers.
     74 config("non_test_config") {
     75   cflags = []
     76 
     77   if (is_clang) {
     78     cflags += [ "-Wglobal-constructors" ]
     79   }
     80 }
     81