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

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

Issue 2451613005: Format GN files and add a presubmit check that GN is properly formatted (Closed)
Patch Set: Fix gn args Created 4 years, 1 month 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 | « runtime/vm/BUILD.gn ('k') | tools/gn.py » ('j') | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 config("internal_config") { 5 config("internal_config") {
6 visibility = [ ":*" ] # Only targets in this file can depend on this. 6 visibility = [ ":*" ] # Only targets in this file can depend on this.
7 cflags = [ 7 cflags = [
8 "-Wall", 8 "-Wall",
9 "-Wextra", 9 "-Wextra",
10 "-Wno-missing-field-initializers", 10 "-Wno-missing-field-initializers",
(...skipping 12 matching lines...) Expand all
23 "-fno-builtin-free", 23 "-fno-builtin-free",
24 "-fno-builtin-realloc", 24 "-fno-builtin-realloc",
25 "-fno-builtin-calloc", 25 "-fno-builtin-calloc",
26 "-fno-builtin-cfree", 26 "-fno-builtin-cfree",
27 "-fno-builtin-memalign", 27 "-fno-builtin-memalign",
28 "-fno-builtin-posix_memalign", 28 "-fno-builtin-posix_memalign",
29 "-fno-builtin-valloc", 29 "-fno-builtin-valloc",
30 "-fno-builtin-pvalloc", 30 "-fno-builtin-pvalloc",
31 ] 31 ]
32 if (is_clang) { 32 if (is_clang) {
33 cflags += [ 33 cflags += [ "-Wno-unused-const-variable" ]
34 "-Wno-unused-const-variable",
35 ]
36 } 34 }
37 } 35 }
38 36
39 config("link_config") { 37 config("link_config") {
40 visibility = [ ":*" ] # Only targets in this file can depend on this. 38 visibility = [ ":*" ] # Only targets in this file can depend on this.
41 ldflags = [ 39 ldflags = [
42 # Don't let linker rip this symbol out, otherwise the heap&cpu 40 # Don't let linker rip this symbol out, otherwise the heap&cpu
43 # profilers will not initialize properly on startup. 41 # profilers will not initialize properly on startup.
44 "-Wl,-uIsHeapProfilerRunning,-uProfilerStart", 42 "-Wl,-uIsHeapProfilerRunning,-uProfilerStart",
45 ] 43 ]
46 } 44 }
47 45
48 source_set("dynamic_annotations") { 46 source_set("dynamic_annotations") {
49 configs -= [ "//build/config/compiler:chromium_code" ] 47 configs -= [ "//build/config/compiler:chromium_code" ]
50 configs += [ ":internal_config" ] 48 configs += [ ":internal_config" ]
51 49
52 include_dirs = [ 50 include_dirs = [
53 "include", 51 "include",
54 "gperftools/src/base", 52 "gperftools/src/base",
55 "gperftools/src", 53 "gperftools/src",
56 ] 54 ]
57 55
58 sources = [ 56 sources = [
59 "gperftools/src/base/dynamic_annotations.c", 57 "gperftools/src/base/dynamic_annotations.c",
60 "gperftools/src/base/dynamic_annotations.h", 58 "gperftools/src/base/dynamic_annotations.h",
61 ] 59 ]
62 } 60 }
63 61
64 tcmalloc_sources_list = exec_script("../../tools/gypi_to_gn.py", 62 tcmalloc_sources_list = exec_script("../../tools/gypi_to_gn.py",
65 [rebase_path("tcmalloc_sources.gypi")], 63 [ rebase_path("tcmalloc_sources.gypi") ],
66 "scope", 64 "scope",
67 ["tcmalloc_sources.gypi"]) 65 [ "tcmalloc_sources.gypi" ])
68
69 66
70 source_set("tcmalloc") { 67 source_set("tcmalloc") {
71 configs -= [ "//build/config/compiler:chromium_code" ] 68 configs -= [ "//build/config/compiler:chromium_code" ]
72 configs += [ ":internal_config" ] 69 configs += [ ":internal_config" ]
73 70
74 public_configs = [":link_config"] 71 public_configs = [ ":link_config" ]
75 72
76 deps = [ 73 deps = [
77 ":dynamic_annotations" 74 ":dynamic_annotations",
78 ] 75 ]
79 76
80 include_dirs = [ 77 include_dirs = [
81 "include", 78 "include",
82 "gperftools/src/base", 79 "gperftools/src/base",
83 "gperftools/src", 80 "gperftools/src",
84 ] 81 ]
85 82
86 # Disable the heap checker in tcmalloc. 83 # Disable the heap checker in tcmalloc.
87 defines = [ 84 defines = [
88 "ENABLE_EMERGENCY_MALLOC", 85 "ENABLE_EMERGENCY_MALLOC",
89 "NO_HEAP_CHECK", 86 "NO_HEAP_CHECK",
87
90 # Disable debug even in a Dart Debug build. It is too slow. 88 # Disable debug even in a Dart Debug build. It is too slow.
91 "NDEBUG", 89 "NDEBUG",
92 ] 90 ]
93 91
94 # Disable stack sampling for heap profiling in Product builds. 92 # Disable stack sampling for heap profiling in Product builds.
95 if (is_product) { 93 if (is_product) {
96 defines += [ 94 defines += [ "NO_TCMALLOC_SAMPLES" ]
97 "NO_TCMALLOC_SAMPLES",
98 ]
99 } 95 }
100 96
101 cflags = [ 97 cflags = [
102 "-Wnon-virtual-dtor", 98 "-Wnon-virtual-dtor",
103 "-Woverloaded-virtual", 99 "-Woverloaded-virtual",
104 "-fno-rtti", 100 "-fno-rtti",
105 "-fpermissive", 101 "-fpermissive",
106 ] 102 ]
107 103
108 if (!is_clang && current_cpu == "x86") { 104 if (!is_clang && current_cpu == "x86") {
109 cflags += [ 105 cflags += [ "-Wno-format" ]
110 "-Wno-format"
111 ]
112 } 106 }
113 107
114 set_sources_assignment_filter([ 108 set_sources_assignment_filter([
115 # No debug allocator. 109 # No debug allocator.
116 "gperftools/src/debugallocation.cc", 110 "gperftools/src/debugallocation.cc",
117 # Not needed when using emergency malloc. 111
118 "gperftools/src/fake_stacktrace_scope.cc", 112 # Not needed when using emergency malloc.
119 # Not using the cpuprofiler 113 "gperftools/src/fake_stacktrace_scope.cc",
120 "gperftools/src/base/thread_lister.c", 114
121 "gperftools/src/base/thread_lister.h", 115 # Not using the cpuprofiler
122 "gperftools/src/profile-handler.cc", 116 "gperftools/src/base/thread_lister.c",
123 "gperftools/src/profile-handler.h", 117 "gperftools/src/base/thread_lister.h",
124 "gperftools/src/profiledata.cc", 118 "gperftools/src/profile-handler.cc",
125 "gperftools/src/profiledata.h", 119 "gperftools/src/profile-handler.h",
126 "gperftools/src/profiler.cc", 120 "gperftools/src/profiledata.cc",
127 ]) 121 "gperftools/src/profiledata.h",
122 "gperftools/src/profiler.cc",
123 ])
128 124
129 sources = tcmalloc_sources_list.sources 125 sources = tcmalloc_sources_list.sources
130 } 126 }
OLDNEW
« no previous file with comments | « runtime/vm/BUILD.gn ('k') | tools/gn.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698