| OLD | NEW |
| 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 import("../../build/executable_suffix.gni") | 5 import("../../build/executable_suffix.gni") |
| 6 import("../../build/prebuilt_dart_sdk.gni") | 6 import("../../build/prebuilt_dart_sdk.gni") |
| 7 import("../../utils/generate_patch_sdk.gni") | 7 import("../../utils/generate_patch_sdk.gni") |
| 8 import("gypi_contents.gni") | 8 import("gypi_contents.gni") |
| 9 import("../runtime_args.gni") | 9 import("../runtime_args.gni") |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 libs = [ "dl" ] | 21 libs = [ "dl" ] |
| 22 if (!is_android) { | 22 if (!is_android) { |
| 23 libs += [ "pthread" ] | 23 libs += [ "pthread" ] |
| 24 } | 24 } |
| 25 if (is_linux) { | 25 if (is_linux) { |
| 26 libs += [ "rt" ] | 26 libs += [ "rt" ] |
| 27 } | 27 } |
| 28 } | 28 } |
| 29 } | 29 } |
| 30 | 30 |
| 31 static_library("libdart_platform") { | 31 template("build_libdart_platform") { |
| 32 configs += [ | 32 extra_configs = [] |
| 33 "..:dart_config", | 33 if (defined(invoker.extra_configs)) { |
| 34 "..:dart_maybe_product_config", | 34 extra_configs += invoker.extra_configs |
| 35 ] | |
| 36 if (is_fuchsia) { | |
| 37 configs -= [ "//build/config:symbol_visibility_hidden" ] | |
| 38 deps = [ | |
| 39 "//apps/tracing/lib/trace", | |
| 40 ] | |
| 41 } | 35 } |
| 42 public_configs = [ ":libdart_vm_config" ] | 36 static_library(target_name) { |
| 37 configs += [ "..:dart_config" ] + extra_configs |
| 38 if (is_fuchsia) { |
| 39 configs -= [ "//build/config:symbol_visibility_hidden" ] |
| 40 deps = [ |
| 41 "//apps/tracing/lib/trace", |
| 42 ] |
| 43 } |
| 44 public_configs = [ ":libdart_vm_config" ] |
| 43 | 45 |
| 44 sources = rebase_path(processed_gypis.platform_sources, ".", "../platform") | 46 sources = rebase_path(processed_gypis.platform_sources, ".", "../platform") |
| 45 | 47 |
| 46 include_dirs = [ ".." ] | 48 include_dirs = [ ".." ] |
| 49 } |
| 50 } |
| 51 |
| 52 build_libdart_platform("libdart_platform") { |
| 53 extra_configs = [ "..:dart_maybe_product_config" ] |
| 54 } |
| 55 |
| 56 build_libdart_platform("libdart_platform_product") { |
| 57 extra_configs = [ "..:dart_product_config" ] |
| 47 } | 58 } |
| 48 | 59 |
| 49 vm_sources_list = processed_gypis.vm_sources | 60 vm_sources_list = processed_gypis.vm_sources |
| 50 | 61 |
| 51 source_set("libdart_vm_jit") { | 62 template("build_libdart_vm") { |
| 52 configs += [ | 63 extra_configs = [] |
| 53 "..:dart_config", | 64 if (defined(invoker.extra_configs)) { |
| 54 "..:dart_maybe_product_config", | 65 extra_configs += invoker.extra_configs |
| 55 ] | |
| 56 if (is_fuchsia) { | |
| 57 configs -= [ "//build/config:symbol_visibility_hidden" ] | |
| 58 deps = [ | |
| 59 "//apps/tracing/lib/trace", | |
| 60 ] | |
| 61 } | 66 } |
| 62 public_configs = [ ":libdart_vm_config" ] | 67 source_set(target_name) { |
| 63 set_sources_assignment_filter([ | 68 configs += [ "..:dart_config" ] + extra_configs |
| 64 "*_test.cc", | 69 if (is_fuchsia) { |
| 65 "*_test.h", | 70 configs -= [ "//build/config:symbol_visibility_hidden" ] |
| 66 ]) | 71 deps = [ |
| 67 sources = vm_sources_list | 72 "//apps/tracing/lib/trace", |
| 68 include_dirs = [ ".." ] | 73 ] |
| 74 } |
| 75 public_configs = [ ":libdart_vm_config" ] |
| 76 set_sources_assignment_filter([ |
| 77 "*_test.cc", |
| 78 "*_test.h", |
| 79 ]) |
| 80 sources = vm_sources_list |
| 81 include_dirs = [ ".." ] |
| 82 } |
| 69 } | 83 } |
| 70 | 84 |
| 71 source_set("libdart_vm_precompiled_runtime") { | 85 build_libdart_vm("libdart_vm_jit") { |
| 72 configs += [ | 86 extra_configs = [ "..:dart_maybe_product_config" ] |
| 73 "..:dart_config", | 87 } |
| 88 |
| 89 build_libdart_vm("libdart_vm_jit_product") { |
| 90 extra_configs = [ "..:dart_product_config" ] |
| 91 } |
| 92 |
| 93 build_libdart_vm("libdart_vm_precompiled_runtime") { |
| 94 extra_configs = [ |
| 74 "..:dart_maybe_product_config", | 95 "..:dart_maybe_product_config", |
| 75 "..:dart_precompiled_runtime_config", | 96 "..:dart_precompiled_runtime_config", |
| 76 ] | 97 ] |
| 77 if (is_fuchsia) { | |
| 78 configs -= [ "//build/config:symbol_visibility_hidden" ] | |
| 79 deps = [ | |
| 80 "//apps/tracing/lib/trace", | |
| 81 ] | |
| 82 } | |
| 83 public_configs = [ ":libdart_vm_config" ] | |
| 84 set_sources_assignment_filter([ | |
| 85 "*_test.cc", | |
| 86 "*_test.h", | |
| 87 ]) | |
| 88 sources = vm_sources_list | |
| 89 include_dirs = [ ".." ] | |
| 90 } | 98 } |
| 91 | 99 |
| 92 source_set("libdart_vm_nosnapshot") { | 100 build_libdart_vm("libdart_vm_precompiled_runtime_product") { |
| 93 configs += [ | 101 extra_configs = [ |
| 94 "..:dart_config", | 102 "..:dart_product_config", |
| 103 "..:dart_precompiled_runtime_config", |
| 104 ] |
| 105 } |
| 106 |
| 107 build_libdart_vm("libdart_vm_nosnapshot") { |
| 108 extra_configs = [ |
| 95 "..:dart_maybe_product_config", | 109 "..:dart_maybe_product_config", |
| 96 "..:dart_no_snapshot_config", | 110 "..:dart_no_snapshot_config", |
| 97 ] | 111 ] |
| 98 if (is_fuchsia) { | |
| 99 configs -= [ "//build/config:symbol_visibility_hidden" ] | |
| 100 deps = [ | |
| 101 "//apps/tracing/lib/trace", | |
| 102 ] | |
| 103 } | |
| 104 public_configs = [ ":libdart_vm_config" ] | |
| 105 set_sources_assignment_filter([ | |
| 106 "*_test.cc", | |
| 107 "*_test.h", | |
| 108 ]) | |
| 109 sources = vm_sources_list | |
| 110 include_dirs = [ ".." ] | |
| 111 } | 112 } |
| 112 | 113 |
| 113 source_set("libdart_vm_nosnapshot_with_precompiler") { | 114 build_libdart_vm("libdart_vm_nosnapshot_with_precompiler") { |
| 114 configs += [ | 115 extra_configs = [ |
| 115 "..:dart_config", | |
| 116 "..:dart_maybe_product_config", | 116 "..:dart_maybe_product_config", |
| 117 "..:dart_precompiler_config", | 117 "..:dart_precompiler_config", |
| 118 "..:dart_no_snapshot_config", | 118 "..:dart_no_snapshot_config", |
| 119 ] | 119 ] |
| 120 if (is_fuchsia) { | |
| 121 configs -= [ "//build/config:symbol_visibility_hidden" ] | |
| 122 deps = [ | |
| 123 "//apps/tracing/lib/trace", | |
| 124 ] | |
| 125 } | |
| 126 public_configs = [ ":libdart_vm_config" ] | |
| 127 set_sources_assignment_filter([ | |
| 128 "*_test.cc", | |
| 129 "*_test.h", | |
| 130 ]) | |
| 131 sources = vm_sources_list | |
| 132 include_dirs = [ ".." ] | |
| 133 } | 120 } |
| 134 | 121 |
| 135 source_set("libdart_vm_with_precompiler") { | 122 build_libdart_vm("libdart_vm_nosnapshot_with_precompiler_product") { |
| 136 configs += [ | 123 extra_configs = [ |
| 137 "..:dart_config", | 124 "..:dart_product_config", |
| 125 "..:dart_precompiler_config", |
| 126 "..:dart_no_snapshot_config", |
| 127 ] |
| 128 } |
| 129 |
| 130 build_libdart_vm("libdart_vm_with_precompiler") { |
| 131 extra_configs = [ |
| 138 "..:dart_maybe_product_config", | 132 "..:dart_maybe_product_config", |
| 139 "..:dart_precompiler_config", | 133 "..:dart_precompiler_config", |
| 140 ] | 134 ] |
| 141 if (is_fuchsia) { | 135 } |
| 142 configs -= [ "//build/config:symbol_visibility_hidden" ] | 136 |
| 143 deps = [ | 137 build_libdart_vm("libdart_vm_with_precompiler_product") { |
| 144 "//apps/tracing/lib/trace", | 138 extra_configs = [ |
| 145 ] | 139 "..:dart_product_config", |
| 146 } | 140 "..:dart_precompiler_config", |
| 147 public_configs = [ ":libdart_vm_config" ] | 141 ] |
| 148 set_sources_assignment_filter([ | |
| 149 "*_test.cc", | |
| 150 "*_test.h", | |
| 151 ]) | |
| 152 sources = vm_sources_list | |
| 153 include_dirs = [ ".." ] | |
| 154 } | 142 } |
| 155 | 143 |
| 156 template("process_library_source") { | 144 template("process_library_source") { |
| 157 assert(defined(invoker.libsources), "Need libsources in $target_name") | 145 assert(defined(invoker.libsources), "Need libsources in $target_name") |
| 158 assert(defined(invoker.output), "Need output in $target_name") | 146 assert(defined(invoker.output), "Need output in $target_name") |
| 159 action(target_name) { | 147 action(target_name) { |
| 160 visibility = [ ":*" ] # Only targets in this file can see this. | 148 visibility = [ ":*" ] # Only targets in this file can see this. |
| 161 libsources = invoker.libsources | 149 libsources = invoker.libsources |
| 162 | 150 |
| 163 script = invoker.script | 151 script = invoker.script |
| (...skipping 28 matching lines...) Expand all Loading... |
| 192 "--include", | 180 "--include", |
| 193 "vm/bootstrap.h", | 181 "vm/bootstrap.h", |
| 194 "--var_name", | 182 "--var_name", |
| 195 "dart::Bootstrap::${libname}_${kind}_paths_", | 183 "dart::Bootstrap::${libname}_${kind}_paths_", |
| 196 "--library_name", | 184 "--library_name", |
| 197 "dart:${libname}", | 185 "dart:${libname}", |
| 198 ] | 186 ] |
| 199 } | 187 } |
| 200 } | 188 } |
| 201 | 189 |
| 190 template("build_libdart_lib") { |
| 191 extra_configs = [] |
| 192 if (defined(invoker.extra_configs)) { |
| 193 extra_configs += invoker.extra_configs |
| 194 } |
| 195 extra_deps = [] |
| 196 if (defined(invoker.extra_deps)) { |
| 197 extra_deps += invoker.extra_deps |
| 198 } |
| 199 extra_sources = [] |
| 200 if (defined(invoker.extra_sources)) { |
| 201 extra_sources += invoker.extra_sources |
| 202 } |
| 203 source_set(target_name) { |
| 204 configs += [ "..:dart_config" ] + extra_configs |
| 205 if (is_fuchsia) { |
| 206 configs -= [ "//build/config:symbol_visibility_hidden" ] |
| 207 } |
| 208 deps = extra_deps |
| 209 sources = extra_sources |
| 210 include_dirs = [ ".." ] |
| 211 } |
| 212 } |
| 213 |
| 202 # This templates expects invoker.sources to be a list of lists. | 214 # This templates expects invoker.sources to be a list of lists. |
| 203 # The lists contain the following information about each library: | 215 # The lists contain the following information about each library: |
| 204 # library name (string) | 216 # library name (string) |
| 205 # library sources (list of strings) | 217 # library sources (list of strings) |
| 206 # library source base path (string) | 218 # library source base path (string) |
| 207 # filename (string) | 219 # filename (string) |
| 208 # do_patch (boolean) | 220 # do_patch (boolean) |
| 209 # | 221 # |
| 210 # If do_patch is true, the lists additionally contains | 222 # If do_patch is true, the lists additionally contains |
| 211 # patch sources (list of strings) | 223 # patch sources (list of strings) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 241 liboutputs += [ "$target_gen_dir/${filename}_gen.cc" ] | 253 liboutputs += [ "$target_gen_dir/${filename}_gen.cc" ] |
| 242 libdeps += [ ":generate_${filename}_cc_file" ] | 254 libdeps += [ ":generate_${filename}_cc_file" ] |
| 243 if (do_patch) { | 255 if (do_patch) { |
| 244 liboutputs += [ "$target_gen_dir/${filename}_patch_gen.cc" ] | 256 liboutputs += [ "$target_gen_dir/${filename}_patch_gen.cc" ] |
| 245 libdeps += [ ":generate_${filename}_patch_cc_file" ] | 257 libdeps += [ ":generate_${filename}_patch_cc_file" ] |
| 246 } | 258 } |
| 247 } | 259 } |
| 248 | 260 |
| 249 all_libsources = rebase_path(invoker.allsources, ".", "../lib") | 261 all_libsources = rebase_path(invoker.allsources, ".", "../lib") |
| 250 | 262 |
| 251 source_set("libdart_lib_nosnapshot_with_precompiler") { | 263 build_libdart_lib("libdart_lib_nosnapshot_with_precompiler") { |
| 252 configs += [ | 264 extra_configs = [ |
| 253 "..:dart_config", | |
| 254 "..:dart_maybe_product_config", | 265 "..:dart_maybe_product_config", |
| 255 "..:dart_precompiler_config", | 266 "..:dart_precompiler_config", |
| 256 ] | 267 ] |
| 257 if (is_fuchsia) { | 268 extra_deps = libdeps |
| 258 configs -= [ "//build/config:symbol_visibility_hidden" ] | 269 extra_sources = all_libsources + [ "bootstrap.cc" ] + liboutputs |
| 259 } | |
| 260 deps = libdeps | |
| 261 sources = all_libsources + [ "bootstrap.cc" ] + liboutputs | |
| 262 include_dirs = [ ".." ] | |
| 263 } | 270 } |
| 264 | 271 |
| 265 source_set("libdart_lib_with_precompiler") { | 272 build_libdart_lib("libdart_lib_nosnapshot_with_precompiler_product") { |
| 266 configs += [ | 273 extra_configs = [ |
| 267 "..:dart_config", | 274 "..:dart_product_config", |
| 275 "..:dart_precompiler_config", |
| 276 ] |
| 277 extra_deps = libdeps |
| 278 extra_sources = all_libsources + [ "bootstrap.cc" ] + liboutputs |
| 279 } |
| 280 |
| 281 build_libdart_lib("libdart_lib_with_precompiler") { |
| 282 extra_configs = [ |
| 268 "..:dart_maybe_product_config", | 283 "..:dart_maybe_product_config", |
| 269 "..:dart_precompiler_config", | 284 "..:dart_precompiler_config", |
| 270 ] | 285 ] |
| 271 if (is_fuchsia) { | 286 extra_deps = libdeps |
| 272 configs -= [ "//build/config:symbol_visibility_hidden" ] | 287 extra_sources = all_libsources + [ "bootstrap_nocore.cc" ] |
| 273 } | |
| 274 deps = libdeps | |
| 275 sources = all_libsources + [ "bootstrap_nocore.cc" ] | |
| 276 include_dirs = [ ".." ] | |
| 277 } | 288 } |
| 278 | 289 |
| 279 source_set("libdart_lib_jit") { | 290 build_libdart_lib("libdart_lib_with_precompiler_product") { |
| 280 configs += [ | 291 extra_configs = [ |
| 281 "..:dart_config", | 292 "..:dart_product_config", |
| 282 "..:dart_maybe_product_config", | 293 "..:dart_precompiler_config", |
| 283 ] | 294 ] |
| 284 if (is_fuchsia) { | 295 extra_deps = libdeps |
| 285 configs -= [ "//build/config:symbol_visibility_hidden" ] | 296 extra_sources = all_libsources + [ "bootstrap_nocore.cc" ] |
| 286 } | |
| 287 sources = all_libsources + [ "bootstrap_nocore.cc" ] | |
| 288 include_dirs = [ ".." ] | |
| 289 } | 297 } |
| 290 | 298 |
| 291 source_set("libdart_lib_precompiled_runtime") { | 299 build_libdart_lib("libdart_lib_jit") { |
| 292 configs += [ | 300 extra_configs = [ "..:dart_maybe_product_config" ] |
| 293 "..:dart_config", | 301 extra_sources = all_libsources + [ "bootstrap_nocore.cc" ] |
| 302 } |
| 303 |
| 304 build_libdart_lib("libdart_lib_jit_product") { |
| 305 extra_configs = [ "..:dart_product_config" ] |
| 306 extra_sources = all_libsources + [ "bootstrap_nocore.cc" ] |
| 307 } |
| 308 |
| 309 build_libdart_lib("libdart_lib_precompiled_runtime") { |
| 310 extra_configs = [ |
| 294 "..:dart_maybe_product_config", | 311 "..:dart_maybe_product_config", |
| 295 "..:dart_precompiled_runtime_config", | 312 "..:dart_precompiled_runtime_config", |
| 296 ] | 313 ] |
| 297 if (is_fuchsia) { | 314 extra_sources = all_libsources + [ "bootstrap_nocore.cc" ] |
| 298 configs -= [ "//build/config:symbol_visibility_hidden" ] | 315 } |
| 299 } | 316 |
| 300 sources = all_libsources + [ "bootstrap_nocore.cc" ] | 317 build_libdart_lib("libdart_lib_precompiled_runtime_product") { |
| 301 include_dirs = [ ".." ] | 318 extra_configs = [ |
| 319 "..:dart_product_config", |
| 320 "..:dart_precompiled_runtime_config", |
| 321 ] |
| 322 extra_sources = all_libsources + [ "bootstrap_nocore.cc" ] |
| 302 } | 323 } |
| 303 } | 324 } |
| 304 | 325 |
| 305 generate_core_libraries("core_libraries") { | 326 generate_core_libraries("core_libraries") { |
| 306 sources = [ | 327 sources = [ |
| 307 [ | 328 [ |
| 308 "async", | 329 "async", |
| 309 processed_gypis.async_sdk_sources, | 330 processed_gypis.async_sdk_sources, |
| 310 "../../sdk/lib/async", | 331 "../../sdk/lib/async", |
| 311 "async", | 332 "async", |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 processed_gypis.vmservice_runtime_sources, | 540 processed_gypis.vmservice_runtime_sources, |
| 520 "../lib", | 541 "../lib", |
| 521 ], | 542 ], |
| 522 [ | 543 [ |
| 523 "io", | 544 "io", |
| 524 processed_gypis.bin_io_sources, | 545 processed_gypis.bin_io_sources, |
| 525 "../bin", | 546 "../bin", |
| 526 ], | 547 ], |
| 527 ] | 548 ] |
| 528 } | 549 } |
| OLD | NEW |