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

Side by Side Diff: runtime/vm/BUILD.gn

Issue 2453773002: Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork." (Closed)
Patch Set: 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/tools/concatenate_patches.py ('k') | runtime/vm/vm.gypi » ('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 = [
8 "magenta", 8 "magenta",
9 ] 9 ]
10 } else if (is_win) { 10 } else if (is_win) {
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 "..:dart_no_snapshot_config",] 134 "..:dart_no_snapshot_config",]
135 public_configs = [":libdart_vm_config"] 135 public_configs = [":libdart_vm_config"]
136 set_sources_assignment_filter(["*_test.cc", "*_test.h"]) 136 set_sources_assignment_filter(["*_test.cc", "*_test.h"])
137 sources = vm_sources_list.sources 137 sources = vm_sources_list.sources
138 include_dirs = [ 138 include_dirs = [
139 "..", 139 "..",
140 ] 140 ]
141 } 141 }
142 142
143 143
144 template("generate_library_source") { 144 template("process_library_source") {
145 assert(defined(invoker.libname), "Need libname in $target_name")
146 assert(defined(invoker.filename), "Need a filename in $target_name") 145 assert(defined(invoker.filename), "Need a filename in $target_name")
147 assert(defined(invoker.kind), "Need kind in $target_name")
148 assert(defined(invoker.output), "Need output in $target_name") 146 assert(defined(invoker.output), "Need output in $target_name")
149 assert(defined(invoker.path), "Need path in $target_name") 147 assert(defined(invoker.path), "Need path in $target_name")
150 action(target_name) { 148 action(target_name) {
151 visibility = [ ":*" ] # Only targets in this file can see this. 149 visibility = [ ":*" ] # Only targets in this file can see this.
152 libname = invoker.libname
153 filename = invoker.filename 150 filename = invoker.filename
154 kind = invoker.kind
155 path = invoker.path 151 path = invoker.path
156 152
157 lib_sources_gypi = 153 lib_sources_gypi =
158 exec_script("../../tools/gypi_to_gn.py", 154 exec_script("../../tools/gypi_to_gn.py",
159 [rebase_path("${path}/${filename}_sources.gypi")], 155 [rebase_path("${path}/${filename}_sources.gypi")],
160 "scope", 156 "scope",
161 ["${path}/${filename}_sources.gypi"]) 157 ["${path}/${filename}_sources.gypi"])
162 lib_sources = 158 lib_sources =
163 rebase_path(lib_sources_gypi.sources, ".", path) 159 rebase_path(lib_sources_gypi.sources, ".", path)
164 160
161 script = invoker.script
162 inputs = invoker.inputs + [script]
163 inputs += lib_sources
164 outputs = [invoker.output]
165 args = invoker.args + rebase_path(lib_sources, root_build_dir)
166 }
167 }
168
169
170 template("generate_library_source") {
171 assert(defined(invoker.libname), "Need libname in $target_name")
172 assert(defined(invoker.filename), "Need a filename in $target_name")
173 assert(defined(invoker.kind), "Need kind in $target_name")
174 assert(defined(invoker.output), "Need output in $target_name")
175 assert(defined(invoker.path), "Need path in $target_name")
176
177 process_library_source(target_name) {
178 libname = invoker.libname
179 filename = invoker.filename
180 kind = invoker.kind
181 output = invoker.output
182 path = invoker.path
165 script = "../tools/gen_library_src_paths.py" 183 script = "../tools/gen_library_src_paths.py"
166 inputs = [ 184 inputs = ["../lib/libgen_in.cc"]
167 "../tools/gen_library_src_paths.py",
168 "../lib/libgen_in.cc",
169 ]
170 inputs += lib_sources
171 outputs = [ invoker.output, ]
172 args = [ 185 args = [
173 "--output", rebase_path(invoker.output, root_build_dir), 186 "--output", rebase_path(invoker.output, root_build_dir),
174 "--input_cc", rebase_path("../lib/libgen_in.cc", root_build_dir), 187 "--input_cc", rebase_path("../lib/libgen_in.cc", root_build_dir),
175 "--include", "vm/bootstrap.h", 188 "--include", "vm/bootstrap.h",
176 "--var_name", "dart::Bootstrap::${libname}_${kind}_paths_", 189 "--var_name", "dart::Bootstrap::${libname}_${kind}_paths_",
177 "--library_name", "dart:${libname}",] + 190 "--library_name", "dart:${libname}",
178 rebase_path(lib_sources, root_build_dir) 191 ]
179 } 192 }
180 } 193 }
181 194
182 195
183 # This templates expects invoker.sources to be a list of pairs of strings. 196 # This templates expects invoker.sources to be a list of pairs of strings.
184 # The pairs of strings mean the following. 197 # The pairs of strings mean the following.
185 # library name, file name 198 # library name, file name
186 # e.g. for the "internal" library named "dart:_internal", 199 # e.g. for the "internal" library named "dart:_internal",
187 # with sources listed at sdk/lib/internal/internal_sources.gypi and 200 # with sources listed at sdk/lib/internal/internal_sources.gypi and
188 # lib/internal_sources.gypi, we have: ["_internal", "internal"] 201 # lib/internal_sources.gypi, we have: ["_internal", "internal"]
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 ["developer", "developer", true, "../../sdk/lib/developer", "../lib"], 305 ["developer", "developer", true, "../../sdk/lib/developer", "../lib"],
293 ["_internal", "internal", true, "../../sdk/lib/internal", "../lib"], 306 ["_internal", "internal", true, "../../sdk/lib/internal", "../lib"],
294 ["isolate", "isolate", true, "../../sdk/lib/isolate", "../lib"], 307 ["isolate", "isolate", true, "../../sdk/lib/isolate", "../lib"],
295 ["math", "math", true, "../../sdk/lib/math", "../lib"], 308 ["math", "math", true, "../../sdk/lib/math", "../lib"],
296 ["mirrors", "mirrors", true, "../../sdk/lib/mirrors", "../lib"], 309 ["mirrors", "mirrors", true, "../../sdk/lib/mirrors", "../lib"],
297 ["profiler", "profiler", false, "../../sdk/lib/profiler"], 310 ["profiler", "profiler", false, "../../sdk/lib/profiler"],
298 ["typed_data", "typed_data", false, "../lib"], 311 ["typed_data", "typed_data", false, "../lib"],
299 ["_vmservice", "vmservice", true, "../../sdk/lib/vmservice", "../lib"], 312 ["_vmservice", "vmservice", true, "../../sdk/lib/vmservice", "../lib"],
300 ] 313 ]
301 } 314 }
315
316
317 template("concatenate_patch") {
318 assert(defined(invoker.libname), "Need a name in $target_name")
319 assert(defined(invoker.dir), "Need a dir in $target_name")
320 assert(defined(invoker.output), "Need an output in $target_name")
321
322 process_library_source(target_name) {
323 output = invoker.output
324 path = "../${invoker.dir}"
325 filename = invoker.libname
326 script = "../tools/concatenate_patches.py"
327 args = [ "--output", rebase_path(output, root_build_dir)]
328 inputs = []
329 }
330 }
331
332
333 template("generate_patched_sdk") {
334 assert(defined(invoker.libraries), "Need libraries in $target_name")
335
336 concatenation_target_names = []
337 concatenation_files = []
338
339 # Concatenate vm library patches.
340 foreach(library, invoker.libraries) {
341 name = library[1]
342
343 target_output = "$target_gen_dir/patches/${name}_patch.dart"
344 concatenate_patch("concatenate_${name}_patch") {
345 libname = name
346 dir = library[0]
347 output = target_output
348 }
349 concatenation_target_names += [ ":concatenate_${name}_patch" ]
350 concatenation_files += [ target_output ]
351 }
352
353 # Build the patched sdk out of the concatenated patches and the special
354 # libraries.
355 action(target_name) {
356 deps = concatenation_target_names
357
358 patches_dir = "$target_gen_dir/patches"
359 patched_sdk_dir = "$target_gen_dir/patched_sdk"
360
361 script = "../../tools/patch_sdk.py"
362
363 # We list all files which make up the sdk (modulo patches) and get them back
364 # as a GN list object.
365 shared_sdk_sources = exec_script(
366 "../../tools/list_dart_files.py", ["../../sdk/lib"], "list lines")
367
368 # We list the `patch_sdk.dart` tool here because the [script] (which is
369 # implicitly an input) will call it.
370 inputs = [ "../../tools/patch_sdk.dart" ]
371 # Files below are not patches, they will not be in [concatenation_files] but
372 # the `patch_sdk.dart` script will copy them into the patched sdk.
373 inputs += [
374 "../lib/typed_data.dart",
375 "../bin/builtin.dart",
376 "../bin/vmservice/vmservice_io.dart",
377 "../bin/vmservice/loader.dart",
378 "../bin/vmservice/server.dart",
379 ]
380 # Add all the normal sdk sources.
381 inputs += shared_sdk_sources
382 # Add all the concatenated patch files.
383 inputs += concatenation_files
384
385 outputs = [
386 # Instead of listing all outputs we list a single well-known one.
387 "${patched_sdk_dir}/lib/core/core.dart",
388 ]
389
390 args = [
391 "vm",
392 rebase_path("../../sdk"),
393 rebase_path(patches_dir, root_build_dir),
394 rebase_path(patched_sdk_dir, root_build_dir),
395 ]
396 }
397 }
398
399
400 generate_patched_sdk("patched_sdk") {
401 libraries = [
402 ["lib", "async"],
403 ["lib", "collection"],
404 ["lib", "convert"],
405 ["lib", "core"],
406 ["lib", "developer"],
407 ["lib", "internal"],
408 ["lib", "isolate"],
409 ["lib", "math"],
410 ["lib", "mirrors"],
411 ["lib", "profiler"],
412 ["lib", "vmservice"],
413 ["bin", "io"],
414 ]
415 }
OLDNEW
« no previous file with comments | « runtime/tools/concatenate_patches.py ('k') | runtime/vm/vm.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698