OLD | NEW |
1 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
2 # | 2 # |
3 # Use of this source code is governed by a BSD-style license | 3 # Use of this source code is governed by a BSD-style license |
4 # that can be found in the LICENSE file in the root of the source | 4 # that can be found in the LICENSE file in the root of the source |
5 # tree. An additional intellectual property rights grant can be found | 5 # tree. An additional intellectual property rights grant can be found |
6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
8 | 8 |
9 if (is_win) { | 9 if (is_win) { |
10 gflags_gen_arch_root = "gen/win" | 10 gflags_gen_arch_root = "gen/win" |
11 } else { | 11 } else { |
12 gflags_gen_arch_root = "gen/posix" | 12 gflags_gen_arch_root = "gen/posix" |
13 } | 13 } |
14 | 14 |
15 config("gflags_config") { | 15 config("gflags_config") { |
16 include_dirs = [ | 16 include_dirs = [ |
17 "$gflags_gen_arch_root/include", # For configured files. | 17 "$gflags_gen_arch_root/include", # For configured files. |
18 "src", # For everything else. | 18 "src/src", # For everything else. |
19 ] | 19 ] |
20 | 20 |
21 defines = [ | 21 defines = [ |
22 # These macros exist so flags and symbols are properly exported when | 22 # These macros exist so flags and symbols are properly exported when |
23 # building DLLs. Since we don't build DLLs, we need to disable them. | 23 # building DLLs. Since we don't build DLLs, we need to disable them. |
24 "GFLAGS_DLL_DECL=", | 24 "GFLAGS_DLL_DECL=", |
25 "GFLAGS_DLL_DECLARE_FLAG=", | 25 "GFLAGS_DLL_DECLARE_FLAG=", |
26 "GFLAGS_DLL_DEFINE_FLAG=", | 26 "GFLAGS_DLL_DEFINE_FLAG=", |
27 ] | 27 ] |
28 | 28 |
29 # GN orders flags on a target before flags from configs. The default config | 29 # GN orders flags on a target before flags from configs. The default config |
30 # adds -Wall, and this flag have to be after -Wall -- so they need to | 30 # adds -Wall, and this flag have to be after -Wall -- so they need to |
31 # come from a config and can't be on the target directly. | 31 # come from a config and can't be on the target directly. |
32 if (is_clang) { | 32 if (is_clang) { |
33 cflags = [ "-Wno-unused-local-typedef" ] | 33 cflags = [ "-Wno-unused-local-typedef" ] |
34 } | 34 } |
35 } | 35 } |
36 | 36 |
37 source_set("gflags") { | 37 source_set("gflags") { |
| 38 cflags = [] |
38 sources = [ | 39 sources = [ |
39 "src/gflags.cc", | 40 "src/src/gflags.cc", |
40 "src/gflags_completions.cc", | 41 "src/src/gflags_completions.cc", |
41 "src/gflags_reporting.cc", | 42 "src/src/gflags_reporting.cc", |
42 ] | 43 ] |
43 if (is_win) { | 44 if (is_win) { |
44 sources += [ "src/windows/port.cc" ] | 45 sources += [ "src/src/windows_port.cc" ] |
45 | 46 |
46 cflags = [ | 47 cflags += [ |
47 "/wd4005", # WIN32_LEAN_AND_MEAN. | 48 "/wd4005", # WIN32_LEAN_AND_MEAN. |
48 "/wd4267", # Conversion from size_t to "type". | 49 "/wd4267", # Conversion from size_t to "type". |
49 ] | 50 ] |
50 } | 51 } |
51 | 52 |
52 include_dirs = [ "$gflags_gen_arch_root/include/private" ] # For config.h | 53 include_dirs = [ |
| 54 "$gflags_gen_arch_root/include/gflags", # For configured files. |
| 55 "$gflags_gen_arch_root/include/private", # For config.h |
| 56 ] |
53 | 57 |
54 public_configs = [ ":gflags_config" ] | 58 public_configs = [ ":gflags_config" ] |
55 | 59 |
56 configs -= [ "//build/config/compiler:chromium_code" ] | 60 configs -= [ "//build/config/compiler:chromium_code" ] |
57 configs += [ "//build/config/compiler:no_chromium_code" ] | 61 configs += [ "//build/config/compiler:no_chromium_code" ] |
58 | 62 |
| 63 if (is_win) { |
| 64 configs -= [ "//build/config/win:unicode" ] |
| 65 } |
| 66 |
59 if (is_clang) { | 67 if (is_clang) { |
60 # TODO(andrew): Look into fixing this warning upstream: | 68 # TODO(andrew): Look into fixing this warning upstream: |
61 # http://code.google.com/p/webrtc/issues/detail?id=760 | 69 # http://code.google.com/p/webrtc/issues/detail?id=760 |
62 configs -= [ "//build/config/clang:extra_warnings" ] | 70 configs -= [ "//build/config/clang:extra_warnings" ] |
| 71 cflags += [ "-Wno-microsoft-include" ] |
63 } | 72 } |
64 } | 73 } |
OLD | NEW |