forked from dart-lang/sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sdk_args.gni
68 lines (60 loc) · 2.62 KB
/
sdk_args.gni
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
_dart_root = get_path_info(".", "abspath")
declare_args() {
# Absolute path to the .git folder.
#
# This is used in rules that need to refer to `.git/logs/HEAD` to include
# a hash in the version string. By default the folder is `.git`, but we define
# it as an argument so it can be overridden by users of `git-worktree` (See
# Issue #33619).
#
# When using git-worktree, you can add
#
# default_git_folder = "/path/to/main/git/repo/.git/worktrees/name/"
#
# to out/ReleaseX64/args.gn. The path above can be extracted from the `.git`
# file under the git worktree folder.
# The script run here should take care of everything automatically though.
default_git_folder = ""
# Whether to enable the SDK hash check that will prevent loading a kernel
# into a VM which was built with a different SDK.
verify_sdk_hash = true
# When verify_sdk_hash is true, this string is used as the verification hash
# instead of calculating one from the contents of the tree using the
# make_version.py script.
dart_sdk_verification_hash = ""
# The location in the build output directory of the built Dart SDK.
dart_sdk_output = "dart-sdk"
# When set to `true` will cause compile_platform action to use a precompiled
# compile_platform.dart script instead of running it from source. This
# can significantly improve iteration time when iteration on changes in
# core libraries.
precompile_tools = false
}
if (default_git_folder == "") {
default_git_folder = exec_script("$_dart_root/tools/get_dot_git_folder.py",
[
rebase_path("$_dart_root/.git"),
"$_dart_root/.git",
],
"trim string")
}
# The SDK hash to build into VM and kernels.
# The value 0000000000 signifies no hash is set, which will disable the check.
if (verify_sdk_hash) {
sdk_hash = dart_sdk_verification_hash
if (sdk_hash == "") {
sdk_hash = exec_script("$_dart_root/tools/make_version.py",
[ "--format={{GIT_HASH}}" ],
"trim string",
[
"$_dart_root/tools/VERSION",
"$_dart_root/tools/utils.py",
"$default_git_folder/logs/HEAD",
])
}
} else {
sdk_hash = "0000000000"
}