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

Side by Side Diff: runtime/vm/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/third_party/double-conversion/src/BUILD.gn ('k') | third_party/tcmalloc/BUILD.gn » ('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) 2014, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2014, 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("libdart_vm_config") { 5 config("libdart_vm_config") {
6 if (defined(is_fuchsia) && is_fuchsia) { 6 if (defined(is_fuchsia) && is_fuchsia) {
7 libs = [ 7 libs = [ "magenta" ]
8 "magenta",
9 ]
10 } else if (is_win) { 8 } else if (is_win) {
11 libs = [ 9 libs = [
12 "advapi32.lib", 10 "advapi32.lib",
13 "shell32.lib", 11 "shell32.lib",
14 "dbghelp.lib", 12 "dbghelp.lib",
15 ] 13 ]
16 } else { 14 } else {
17 libs = [ "dl" ] 15 libs = [ "dl" ]
18 if (!is_android) { 16 if (!is_android) {
19 libs += [ "pthread"] 17 libs += [ "pthread" ]
20 } 18 }
21 if (is_linux) { 19 if (is_linux) {
22 libs += [ "rt" ] 20 libs += [ "rt" ]
23 } 21 }
24 } 22 }
25 } 23 }
26 24
27
28 static_library("libdart_platform") { 25 static_library("libdart_platform") {
29 configs += ["..:dart_config", 26 configs += [
30 "..:dart_maybe_product_config"] 27 "..:dart_config",
31 public_configs = [":libdart_vm_config"] 28 "..:dart_maybe_product_config",
29 ]
30 public_configs = [ ":libdart_vm_config" ]
32 31
33 platform_headers_gypi = 32 platform_headers_gypi =
34 exec_script("../../tools/gypi_to_gn.py", 33 exec_script("../../tools/gypi_to_gn.py",
35 [rebase_path("../platform/platform_headers.gypi")], 34 [ rebase_path("../platform/platform_headers.gypi") ],
36 "scope", 35 "scope",
37 ["../platform/platform_headers.gypi"]) 36 [ "../platform/platform_headers.gypi" ])
38 platform_headers = 37 platform_headers =
39 rebase_path(platform_headers_gypi.sources, ".", "../platform") 38 rebase_path(platform_headers_gypi.sources, ".", "../platform")
40 39
41 platform_sources_gypi = 40 platform_sources_gypi =
42 exec_script("../../tools/gypi_to_gn.py", 41 exec_script("../../tools/gypi_to_gn.py",
43 [rebase_path("../platform/platform_sources.gypi")], 42 [ rebase_path("../platform/platform_sources.gypi") ],
44 "scope", 43 "scope",
45 ["../platform/platform_sources.gypi"]) 44 [ "../platform/platform_sources.gypi" ])
46 platform_sources = 45 platform_sources =
47 rebase_path(platform_sources_gypi.sources, ".", "../platform") 46 rebase_path(platform_sources_gypi.sources, ".", "../platform")
48 47
49 sources = platform_headers + platform_sources 48 sources = platform_headers + platform_sources
50 include_dirs = [ 49 include_dirs = [ ".." ]
51 "..",
52 ]
53 } 50 }
54 51
55
56 vm_sources_list = exec_script("../../tools/gypi_to_gn.py", 52 vm_sources_list = exec_script("../../tools/gypi_to_gn.py",
57 [rebase_path("vm_sources.gypi")], 53 [ rebase_path("vm_sources.gypi") ],
58 "scope", 54 "scope",
59 ["vm_sources.gypi"]) 55 [ "vm_sources.gypi" ])
60
61 56
62 static_library("libdart_vm") { 57 static_library("libdart_vm") {
63 configs += ["..:dart_config", 58 configs += [
64 "..:dart_maybe_product_config", 59 "..:dart_config",
65 "..:dart_maybe_precompiled_runtime_config"] 60 "..:dart_maybe_product_config",
66 public_configs = [":libdart_vm_config"] 61 "..:dart_maybe_precompiled_runtime_config",
67 set_sources_assignment_filter(["*_test.cc", "*_test.h"]) 62 ]
63 public_configs = [ ":libdart_vm_config" ]
64 set_sources_assignment_filter([
65 "*_test.cc",
66 "*_test.h",
67 ])
68 sources = vm_sources_list.sources 68 sources = vm_sources_list.sources
69 include_dirs = [ 69 include_dirs = [ ".." ]
70 "..",
71 ]
72 } 70 }
73 71
74
75 static_library("libdart_vm_noopt") { 72 static_library("libdart_vm_noopt") {
76 configs += ["..:dart_config", 73 configs += [
77 "..:dart_maybe_product_config", 74 "..:dart_config",
78 "..:dart_precompiler_config", 75 "..:dart_maybe_product_config",
79 "..:dart_maybe_precompiled_runtime_config"] 76 "..:dart_precompiler_config",
80 public_configs = [":libdart_vm_config"] 77 "..:dart_maybe_precompiled_runtime_config",
81 set_sources_assignment_filter(["*_test.cc", "*_test.h"]) 78 ]
79 public_configs = [ ":libdart_vm_config" ]
80 set_sources_assignment_filter([
81 "*_test.cc",
82 "*_test.h",
83 ])
82 sources = vm_sources_list.sources 84 sources = vm_sources_list.sources
83 include_dirs = [ 85 include_dirs = [ ".." ]
84 "..",
85 ]
86 } 86 }
87 87
88
89 static_library("libdart_vm_precompiled_runtime") { 88 static_library("libdart_vm_precompiled_runtime") {
90 configs += ["..:dart_config", 89 configs += [
91 "..:dart_maybe_product_config", 90 "..:dart_config",
92 "..:dart_precompiled_runtime_config"] 91 "..:dart_maybe_product_config",
93 public_configs = [":libdart_vm_config"] 92 "..:dart_precompiled_runtime_config",
94 set_sources_assignment_filter(["*_test.cc", "*_test.h"]) 93 ]
94 public_configs = [ ":libdart_vm_config" ]
95 set_sources_assignment_filter([
96 "*_test.cc",
97 "*_test.h",
98 ])
95 sources = vm_sources_list.sources 99 sources = vm_sources_list.sources
96 include_dirs = [ 100 include_dirs = [ ".." ]
97 "..",
98 ]
99 } 101 }
100 102
101
102 static_library("libdart_vm_nosnapshot") { 103 static_library("libdart_vm_nosnapshot") {
103 configs += ["..:dart_config", 104 configs += [
104 "..:dart_maybe_product_config", 105 "..:dart_config",
105 "..:dart_maybe_precompiled_runtime_config", 106 "..:dart_maybe_product_config",
106 "..:dart_no_snapshot_config",] 107 "..:dart_maybe_precompiled_runtime_config",
107 public_configs = [":libdart_vm_config"] 108 "..:dart_no_snapshot_config",
108 set_sources_assignment_filter(["*_test.cc", "*_test.h"]) 109 ]
110 public_configs = [ ":libdart_vm_config" ]
111 set_sources_assignment_filter([
112 "*_test.cc",
113 "*_test.h",
114 ])
109 sources = vm_sources_list.sources 115 sources = vm_sources_list.sources
110 include_dirs = [ 116 include_dirs = [ ".." ]
111 "..",
112 ]
113 } 117 }
114 118
115
116 static_library("libdart_vm_nosnapshot_precompiled_runtime") { 119 static_library("libdart_vm_nosnapshot_precompiled_runtime") {
117 configs += ["..:dart_config", 120 configs += [
118 "..:dart_maybe_product_config", 121 "..:dart_config",
119 "..:dart_precompiled_runtime_config", 122 "..:dart_maybe_product_config",
120 "..:dart_no_snapshot_config",] 123 "..:dart_precompiled_runtime_config",
121 public_configs = [":libdart_vm_config"] 124 "..:dart_no_snapshot_config",
122 set_sources_assignment_filter(["*_test.cc", "*_test.h"]) 125 ]
126 public_configs = [ ":libdart_vm_config" ]
127 set_sources_assignment_filter([
128 "*_test.cc",
129 "*_test.h",
130 ])
123 sources = vm_sources_list.sources 131 sources = vm_sources_list.sources
124 include_dirs = [ 132 include_dirs = [ ".." ]
125 "..",
126 ]
127 } 133 }
128 134
129
130 static_library("libdart_vm_nosnapshot_with_precompiler") { 135 static_library("libdart_vm_nosnapshot_with_precompiler") {
131 configs += ["..:dart_config", 136 configs += [
132 "..:dart_maybe_product_config", 137 "..:dart_config",
133 "..:dart_precompiler_config", 138 "..:dart_maybe_product_config",
134 "..:dart_no_snapshot_config",] 139 "..:dart_precompiler_config",
135 public_configs = [":libdart_vm_config"] 140 "..:dart_no_snapshot_config",
136 set_sources_assignment_filter(["*_test.cc", "*_test.h"]) 141 ]
142 public_configs = [ ":libdart_vm_config" ]
143 set_sources_assignment_filter([
144 "*_test.cc",
145 "*_test.h",
146 ])
137 sources = vm_sources_list.sources 147 sources = vm_sources_list.sources
138 include_dirs = [ 148 include_dirs = [ ".." ]
139 "..",
140 ]
141 } 149 }
142 150
143
144 template("generate_library_source") { 151 template("generate_library_source") {
145 assert(defined(invoker.libname), "Need libname in $target_name") 152 assert(defined(invoker.libname), "Need libname in $target_name")
146 assert(defined(invoker.filename), "Need a filename in $target_name") 153 assert(defined(invoker.filename), "Need a filename in $target_name")
147 assert(defined(invoker.kind), "Need kind in $target_name") 154 assert(defined(invoker.kind), "Need kind in $target_name")
148 assert(defined(invoker.output), "Need output in $target_name") 155 assert(defined(invoker.output), "Need output in $target_name")
149 assert(defined(invoker.path), "Need path in $target_name") 156 assert(defined(invoker.path), "Need path in $target_name")
150 action(target_name) { 157 action(target_name) {
151 visibility = [ ":*" ] # Only targets in this file can see this. 158 visibility = [ ":*" ] # Only targets in this file can see this.
152 libname = invoker.libname 159 libname = invoker.libname
153 filename = invoker.filename 160 filename = invoker.filename
154 kind = invoker.kind 161 kind = invoker.kind
155 path = invoker.path 162 path = invoker.path
156 163
157 lib_sources_gypi = 164 lib_sources_gypi =
158 exec_script("../../tools/gypi_to_gn.py", 165 exec_script("../../tools/gypi_to_gn.py",
159 [rebase_path("${path}/${filename}_sources.gypi")], 166 [ rebase_path("${path}/${filename}_sources.gypi") ],
160 "scope", 167 "scope",
161 ["${path}/${filename}_sources.gypi"]) 168 [ "${path}/${filename}_sources.gypi" ])
162 lib_sources = 169 lib_sources = rebase_path(lib_sources_gypi.sources, ".", path)
163 rebase_path(lib_sources_gypi.sources, ".", path)
164 170
165 script = "../tools/gen_library_src_paths.py" 171 script = "../tools/gen_library_src_paths.py"
166 inputs = [ 172 inputs = [
167 "../tools/gen_library_src_paths.py", 173 "../tools/gen_library_src_paths.py",
168 "../lib/libgen_in.cc", 174 "../lib/libgen_in.cc",
169 ] 175 ]
170 inputs += lib_sources 176 inputs += lib_sources
171 outputs = [ invoker.output, ] 177 outputs = [
178 invoker.output,
179 ]
172 args = [ 180 args = [
173 "--output", rebase_path(invoker.output, root_build_dir), 181 "--output",
174 "--input_cc", rebase_path("../lib/libgen_in.cc", root_build_dir), 182 rebase_path(invoker.output, root_build_dir),
175 "--include", "vm/bootstrap.h", 183 "--input_cc",
176 "--var_name", "dart::Bootstrap::${libname}_${kind}_paths_", 184 rebase_path("../lib/libgen_in.cc", root_build_dir),
177 "--library_name", "dart:${libname}",] + 185 "--include",
178 rebase_path(lib_sources, root_build_dir) 186 "vm/bootstrap.h",
187 "--var_name",
188 "dart::Bootstrap::${libname}_${kind}_paths_",
189 "--library_name",
190 "dart:${libname}",
191 ] + rebase_path(lib_sources, root_build_dir)
179 } 192 }
180 } 193 }
181 194
182
183 # This templates expects invoker.sources to be a list of pairs of strings. 195 # This templates expects invoker.sources to be a list of pairs of strings.
184 # The pairs of strings mean the following. 196 # The pairs of strings mean the following.
185 # library name, file name 197 # library name, file name
186 # e.g. for the "internal" library named "dart:_internal", 198 # e.g. for the "internal" library named "dart:_internal",
187 # with sources listed at sdk/lib/internal/internal_sources.gypi and 199 # with sources listed at sdk/lib/internal/internal_sources.gypi and
188 # lib/internal_sources.gypi, we have: ["_internal", "internal"] 200 # lib/internal_sources.gypi, we have: ["_internal", "internal"]
189 # 201 #
190 # The template iterates over the list, and generates generate_library_source 202 # The template iterates over the list, and generates generate_library_source
191 # actions for each. After that, it generates targets to compile the generated 203 # actions for each. After that, it generates targets to compile the generated
192 # sources to make libdart_lib_nosnapshot and libdart_lib. 204 # sources to make libdart_lib_nosnapshot and libdart_lib.
(...skipping 17 matching lines...) Expand all
210 if (do_patch) { 222 if (do_patch) {
211 patch_path = lib[4] 223 patch_path = lib[4]
212 generate_library_source("generate_${filename}_patch_cc_file") { 224 generate_library_source("generate_${filename}_patch_cc_file") {
213 libname = libname 225 libname = libname
214 filename = filename 226 filename = filename
215 kind = "patch" 227 kind = "patch"
216 path = patch_path 228 path = patch_path
217 output = "$target_gen_dir/${filename}_patch_gen.cc" 229 output = "$target_gen_dir/${filename}_patch_gen.cc"
218 } 230 }
219 } 231 }
220 lib_sources_gypi = {} 232 lib_sources_gypi = {
233 }
221 lib_sources_gypi = 234 lib_sources_gypi =
222 exec_script("../../tools/gypi_to_gn.py", 235 exec_script("../../tools/gypi_to_gn.py",
223 [rebase_path("../lib/${filename}_sources.gypi")], 236 [ rebase_path("../lib/${filename}_sources.gypi") ],
224 "scope", 237 "scope",
225 ["../lib/${filename}_sources.gypi"]) 238 [ "../lib/${filename}_sources.gypi" ])
226 libsources += rebase_path(lib_sources_gypi.sources, ".", "../lib") 239 libsources += rebase_path(lib_sources_gypi.sources, ".", "../lib")
227 liboutputs += ["$target_gen_dir/${filename}_gen.cc"] 240 liboutputs += [ "$target_gen_dir/${filename}_gen.cc" ]
228 libdeps += [":generate_${filename}_cc_file"] 241 libdeps += [ ":generate_${filename}_cc_file" ]
229 if (do_patch) { 242 if (do_patch) {
230 liboutputs += ["$target_gen_dir/${filename}_patch_gen.cc"] 243 liboutputs += [ "$target_gen_dir/${filename}_patch_gen.cc" ]
231 libdeps += [":generate_${filename}_patch_cc_file"] 244 libdeps += [ ":generate_${filename}_patch_cc_file" ]
232 } 245 }
233 } 246 }
234 247
235 static_library("libdart_lib_nosnapshot") { 248 static_library("libdart_lib_nosnapshot") {
236 configs += ["..:dart_config", 249 configs += [
237 "..:dart_maybe_product_config", 250 "..:dart_config",
238 "..:dart_maybe_precompiled_runtime_config"] 251 "..:dart_maybe_product_config",
252 "..:dart_maybe_precompiled_runtime_config",
253 ]
239 deps = libdeps 254 deps = libdeps
240 sources = libsources + ["bootstrap.cc"] + liboutputs 255 sources = libsources + [ "bootstrap.cc" ] + liboutputs
241 include_dirs = [ 256 include_dirs = [ ".." ]
242 "..",
243 ]
244 } 257 }
245 static_library("libdart_lib_nosnapshot_precompiled_runtime") { 258 static_library("libdart_lib_nosnapshot_precompiled_runtime") {
246 configs += ["..:dart_config", 259 configs += [
247 "..:dart_maybe_product_config", 260 "..:dart_config",
248 "..:dart_precompiled_runtime_config"] 261 "..:dart_maybe_product_config",
262 "..:dart_precompiled_runtime_config",
263 ]
249 deps = libdeps 264 deps = libdeps
250 sources = libsources + ["bootstrap.cc"] + liboutputs 265 sources = libsources + [ "bootstrap.cc" ] + liboutputs
251 include_dirs = [ 266 include_dirs = [ ".." ]
252 "..",
253 ]
254 } 267 }
255 static_library("libdart_lib_nosnapshot_with_precompiler") { 268 static_library("libdart_lib_nosnapshot_with_precompiler") {
256 configs += ["..:dart_config", 269 configs += [
257 "..:dart_maybe_product_config", 270 "..:dart_config",
258 "..:dart_precompiler_config" ] 271 "..:dart_maybe_product_config",
272 "..:dart_precompiler_config",
273 ]
259 deps = libdeps 274 deps = libdeps
260 sources = libsources + [ "bootstrap.cc"] + liboutputs 275 sources = libsources + [ "bootstrap.cc" ] + liboutputs
261 include_dirs = [ 276 include_dirs = [ ".." ]
262 "..",
263 ]
264 } 277 }
265 static_library("libdart_lib") { 278 static_library("libdart_lib") {
266 configs += ["..:dart_config", 279 configs += [
267 "..:dart_maybe_product_config", 280 "..:dart_config",
268 "..:dart_maybe_precompiled_runtime_config"] 281 "..:dart_maybe_product_config",
269 sources = libsources + [ "bootstrap_nocore.cc"] 282 "..:dart_maybe_precompiled_runtime_config",
270 include_dirs = [
271 "..",
272 ] 283 ]
284 sources = libsources + [ "bootstrap_nocore.cc" ]
285 include_dirs = [ ".." ]
273 } 286 }
274 static_library("libdart_lib_precompiled_runtime") { 287 static_library("libdart_lib_precompiled_runtime") {
275 configs += ["..:dart_config", 288 configs += [
276 "..:dart_maybe_product_config", 289 "..:dart_config",
277 "..:dart_precompiled_runtime_config"] 290 "..:dart_maybe_product_config",
278 sources = libsources + [ "bootstrap_nocore.cc"] 291 "..:dart_precompiled_runtime_config",
279 include_dirs = [
280 "..",
281 ] 292 ]
293 sources = libsources + [ "bootstrap_nocore.cc" ]
294 include_dirs = [ ".." ]
282 } 295 }
283 } 296 }
284 297
285
286 generate_core_libraries("core_libraries") { 298 generate_core_libraries("core_libraries") {
287 sources = [ 299 sources = [
288 ["async", "async", true, "../../sdk/lib/async", "../lib"], 300 [
289 ["core", "core", true, "../../sdk/lib/core", "../lib"], 301 "async",
290 ["collection", "collection", true, "../../sdk/lib/collection", "../lib"], 302 "async",
291 ["convert", "convert", true, "../../sdk/lib/convert", "../lib"], 303 true,
292 ["developer", "developer", true, "../../sdk/lib/developer", "../lib"], 304 "../../sdk/lib/async",
293 ["_internal", "internal", true, "../../sdk/lib/internal", "../lib"], 305 "../lib",
294 ["isolate", "isolate", true, "../../sdk/lib/isolate", "../lib"], 306 ],
295 ["math", "math", true, "../../sdk/lib/math", "../lib"], 307 [
296 ["mirrors", "mirrors", true, "../../sdk/lib/mirrors", "../lib"], 308 "core",
297 ["profiler", "profiler", false, "../../sdk/lib/profiler"], 309 "core",
298 ["typed_data", "typed_data", false, "../lib"], 310 true,
299 ["_vmservice", "vmservice", true, "../../sdk/lib/vmservice", "../lib"], 311 "../../sdk/lib/core",
312 "../lib",
313 ],
314 [
315 "collection",
316 "collection",
317 true,
318 "../../sdk/lib/collection",
319 "../lib",
320 ],
321 [
322 "convert",
323 "convert",
324 true,
325 "../../sdk/lib/convert",
326 "../lib",
327 ],
328 [
329 "developer",
330 "developer",
331 true,
332 "../../sdk/lib/developer",
333 "../lib",
334 ],
335 [
336 "_internal",
337 "internal",
338 true,
339 "../../sdk/lib/internal",
340 "../lib",
341 ],
342 [
343 "isolate",
344 "isolate",
345 true,
346 "../../sdk/lib/isolate",
347 "../lib",
348 ],
349 [
350 "math",
351 "math",
352 true,
353 "../../sdk/lib/math",
354 "../lib",
355 ],
356 [
357 "mirrors",
358 "mirrors",
359 true,
360 "../../sdk/lib/mirrors",
361 "../lib",
362 ],
363 [
364 "profiler",
365 "profiler",
366 false,
367 "../../sdk/lib/profiler",
368 ],
369 [
370 "typed_data",
371 "typed_data",
372 false,
373 "../lib",
374 ],
375 [
376 "_vmservice",
377 "vmservice",
378 true,
379 "../../sdk/lib/vmservice",
380 "../lib",
381 ],
300 ] 382 ]
301 } 383 }
OLDNEW
« no previous file with comments | « runtime/third_party/double-conversion/src/BUILD.gn ('k') | third_party/tcmalloc/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698