Chromium Code Reviews| Index: gni/isolate.gni |
| diff --git a/gni/isolate.gni b/gni/isolate.gni |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ac1bb79e2935f0e7c2caa11d6272ab7a765778bb |
| --- /dev/null |
| +++ b/gni/isolate.gni |
| @@ -0,0 +1,159 @@ |
| +# Copyright 2016 the V8 project authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
|
Michael Achenbach
2016/06/02 14:23:57
This ports https://cs.chromium.org/chromium/src/v8
|
| +import("//build/config/sanitizers/sanitizers.gni") |
| +import("v8.gni") |
| + |
| +declare_args() { |
| + # Sets the test isolation mode (noop|prepare|check). |
| + v8_test_isolation_mode = "noop" |
| +} |
| + |
| +template("v8_isolate_run") { |
| + # Remember target name as within the action scope the target name will be |
| + # different. |
| + name = target_name |
| + if (name != "" && invoker.isolate != "" && invoker.deps != [] && |
|
Michael Achenbach
2016/06/02 14:23:57
Referencing a bunch of variables here for the sake
vogelheim
2016/06/02 16:18:05
Sorry, I don't get this... could you explain once
Michael Achenbach
2016/06/02 18:32:35
I'd like to have the condition v8_test_isolation_m
|
| + v8_test_isolation_mode != "noop") { |
| + action(name + "_run") { |
| + deps = invoker.deps |
| + |
| + script = "tools/isolate_driver.py" |
| + |
| + sources = [ |
| + invoker.isolate, |
| + ] |
| + |
| + inputs = [ |
| + # Files that are known to be involved in this step. |
| + "tools/swarming_client/isolate.py", |
| + "tools/swarming_client/run_isolated.py", |
| + ] |
| + |
| + outputs = [ |
| + "$root_out_dir/$name.isolated", |
| + ] |
| + |
| + # Translate gn to gyp variables. |
|
Michael Achenbach
2016/06/02 14:23:57
The following 40 lines are probably a bit ugly. Bu
|
| + if (is_asan) { |
| + asan = "1" |
| + } else { |
| + asan = "0" |
| + } |
| + if (is_msan) { |
| + msan = "1" |
| + } else { |
| + msan = "0" |
| + } |
| + if (is_tsan) { |
| + tsan = "1" |
| + } else { |
| + tsan = "0" |
| + } |
| + if (is_cfi) { |
| + cfi_vptr = "1" |
| + } else { |
| + cfi_vptr = "0" |
| + } |
| + if (use_custom_libcxx) { |
| + custom_libcxx = "1" |
| + } else { |
| + custom_libcxx = "0" |
| + } |
| + if (target_cpu == "x86") { |
| + target_arch = "ia32" |
| + } else { |
| + target_arch = target_cpu |
| + } |
| + if (is_debug) { |
| + configuration_name = "Debug" |
| + } else { |
| + configuration_name = "Release" |
| + } |
| + if (is_component_build) { |
| + component = "shared_library" |
| + } else { |
| + component = "static_library" |
| + } |
| + if (icu_use_data_file) { |
| + icu_use_data_file_flag = "1" |
| + } else { |
| + icu_use_data_file_flag = "0" |
| + } |
| + if (v8_use_external_startup_data) { |
| + use_external_startup_data = "1" |
| + } else { |
| + use_external_startup_data = "0" |
| + } |
| + if (v8_use_snapshot) { |
| + use_snapshot = "1" |
| + } else { |
| + use_snapshot = "0" |
| + } |
| + |
| + args = [ |
| + v8_test_isolation_mode, |
| + "--isolated", |
| + rebase_path("$root_out_dir/$name.isolated", root_build_dir), |
| + "--isolate", |
| + rebase_path(invoker.isolate, root_build_dir), |
| + |
| + # Path variables are used to replace file paths when loading a .isolate |
| + # file |
| + "--path-variable", |
| + "DEPTH", |
| + rebase_path("//", root_build_dir), |
| + "--path-variable", |
| + "PRODUCT_DIR", |
| + rebase_path(root_out_dir, root_build_dir), |
| + |
| + # TODO(machenbach): Set variables for remaining features. |
| + "--config-variable", |
| + "CONFIGURATION_NAME=$configuration_name", |
| + "--config-variable", |
| + "OS=$target_os", |
| + "--config-variable", |
| + "asan=$asan", |
| + "--config-variable", |
| + "cfi_vptr=$cfi_vptr", |
| + "--config-variable", |
| + "gcmole=0", |
| + "--config-variable", |
| + "has_valgrind=0", |
| + "--config-variable", |
| + "icu_use_data_file_flag=$icu_use_data_file_flag", |
| + "--config-variable", |
| + "msan=$msan", |
| + "--config-variable", |
| + "tsan=$tsan", |
| + "--config-variable", |
| + "coverage=0", |
| + "--config-variable", |
| + "sanitizer_coverage=0", |
| + "--config-variable", |
| + "component=$component", |
| + "--config-variable", |
| + "target_arch=$target_arch", |
| + "--config-variable", |
| + "use_custom_libcxx=$custom_libcxx", |
| + "--config-variable", |
| + "v8_use_external_startup_data=$use_external_startup_data", |
| + "--config-variable", |
| + "v8_use_snapshot=$use_snapshot", |
| + ] |
| + |
| + if (is_win) { |
| + args += [ |
| + "--config-variable", |
| + "msvs_version=2013", |
| + ] |
| + } else { |
| + args += [ |
| + "--config-variable", |
| + "msvs_version=0", |
| + ] |
| + } |
| + } |
| + } |
| +} |