Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Side by Side Diff: third_party/gflags/BUILD.gn

Issue 2320723007: Revert of Only expose gflags target in non-Chromium and non-fuzzer builds. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import("../../webrtc/build/webrtc.gni") 9 if (is_win) {
10 gflags_gen_arch_root = "gen/win"
11 } else {
12 gflags_gen_arch_root = "gen/posix"
13 }
10 14
11 # gflags can only be used by targets that are not built in Chromium, since 15 config("gflags_config") {
12 # Chromium doesn't have gflags as a dependency). 16 include_dirs = [
13 if (!build_with_chromium && !use_libfuzzer) { 17 "$gflags_gen_arch_root/include", # For configured files.
18 "src/src", # For everything else.
19 ]
20
21 defines = [
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.
24 "GFLAGS_DLL_DECL=",
25 "GFLAGS_DLL_DECLARE_FLAG=",
26 "GFLAGS_DLL_DEFINE_FLAG=",
27 ]
28
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
31 # come from a config and can't be on the target directly.
32 if (is_clang) {
33 cflags = [ "-Wno-unused-local-typedef" ]
34 }
35 }
36
37 source_set("gflags") {
38 cflags = []
39 sources = [
40 "src/src/gflags.cc",
41 "src/src/gflags_completions.cc",
42 "src/src/gflags_reporting.cc",
43 ]
14 if (is_win) { 44 if (is_win) {
15 gflags_gen_arch_root = "gen/win" 45 sources += [ "src/src/windows_port.cc" ]
16 } else { 46
17 gflags_gen_arch_root = "gen/posix" 47 cflags += [
48 "/wd4005", # WIN32_LEAN_AND_MEAN.
49 "/wd4267", # Conversion from size_t to "type".
50 ]
18 } 51 }
19 52
20 config("gflags_config") { 53 include_dirs = [
21 include_dirs = [ 54 "$gflags_gen_arch_root/include/gflags", # For configured files.
22 "$gflags_gen_arch_root/include", # For configured files. 55 "$gflags_gen_arch_root/include/private", # For config.h
23 "src/src", # For everything else. 56 ]
24 ]
25 57
26 defines = [ 58 public_configs = [ ":gflags_config" ]
27 # These macros exist so flags and symbols are properly exported when
28 # building DLLs. Since we don't build DLLs, we need to disable them.
29 "GFLAGS_DLL_DECL=",
30 "GFLAGS_DLL_DECLARE_FLAG=",
31 "GFLAGS_DLL_DEFINE_FLAG=",
32 ]
33 59
34 # GN orders flags on a target before flags from configs. The default config 60 configs -= [ "//build/config/compiler:chromium_code" ]
35 # adds -Wall, and this flag have to be after -Wall -- so they need to 61 configs += [ "//build/config/compiler:no_chromium_code" ]
36 # come from a config and can't be on the target directly. 62
37 if (is_clang) { 63 if (is_win) {
38 cflags = [ "-Wno-unused-local-typedef" ] 64 configs -= [ "//build/config/win:unicode" ]
39 }
40 } 65 }
41 66
42 source_set("gflags") { 67 if (is_clang) {
43 testonly = true 68 # TODO(andrew): Look into fixing this warning upstream:
44 cflags = [] 69 # http://code.google.com/p/webrtc/issues/detail?id=760
45 sources = [ 70 configs -= [ "//build/config/clang:extra_warnings" ]
46 "src/src/gflags.cc", 71 cflags += [ "-Wno-microsoft-include" ]
47 "src/src/gflags_completions.cc",
48 "src/src/gflags_reporting.cc",
49 ]
50 if (is_win) {
51 sources += [ "src/src/windows_port.cc" ]
52
53 cflags += [
54 "/wd4005", # WIN32_LEAN_AND_MEAN.
55 "/wd4267", # Conversion from size_t to "type".
56 ]
57 }
58
59 include_dirs = [
60 "$gflags_gen_arch_root/include/gflags", # For configured files.
61 "$gflags_gen_arch_root/include/private", # For config.h
62 ]
63
64 public_configs = [ ":gflags_config" ]
65
66 configs -= [ "//build/config/compiler:chromium_code" ]
67 configs += [ "//build/config/compiler:no_chromium_code" ]
68
69 if (is_win) {
70 configs -= [ "//build/config/win:unicode" ]
71 }
72
73 if (is_clang) {
74 # TODO(andrew): Look into fixing this warning upstream:
75 # http://code.google.com/p/webrtc/issues/detail?id=760
76 configs -= [ "//build/config/clang:extra_warnings" ]
77 cflags += [ "-Wno-microsoft-include" ]
78 }
79 } 72 }
80 } 73 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698