forked from chromium/mini_chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsysroot.gni
70 lines (61 loc) · 1.9 KB
/
sysroot.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
69
70
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("platform.gni")
if (mini_chromium_is_posix || mini_chromium_is_fuchsia) {
declare_args() {
# A directory containing the system’s header files and libraries. If empty,
# a suitable default will be chosen.
target_sysroot = ""
}
}
if (mini_chromium_is_mac) {
declare_args() {
# The version of the macOS SDK to use. If |target_sysroot| is empty, this
# will inform which SDK version will be chosen. If |mac_sdk| is also empty,
# a suitable default will be chosen. See also |mac_sdk_min|.
mac_sdk = ""
# The minimum version of the macOS system SDK to use. SDK versions older
# than this will be rejected. If |target_sysroot| and |mac_sdk| are both
# empty, the oldest SDK that’s at least this version will be chosen. If
# empty, the system’s default SDK will be chosen.
mac_sdk_min = ""
}
find_mac_sdk_args = []
if (mac_sdk != "") {
find_mac_sdk_args += [
"--exact",
mac_sdk,
]
}
if (mac_sdk_min != "") {
find_mac_sdk_args += [
"--minimum",
mac_sdk_min,
]
}
if (target_sysroot != "") {
find_mac_sdk_args += [
"--path",
target_sysroot,
]
}
find_mac_sdk_output =
exec_script("find_mac_sdk.py", find_mac_sdk_args, "list lines")
mac_sdk = find_mac_sdk_output[0]
target_sysroot = find_mac_sdk_output[1]
} else if (mini_chromium_is_fuchsia) {
declare_args() {
# Path to the Fuchsia SDK.
fuchsia_sdk = "//third_party/fuchsia/sdk/linux-amd64"
}
if (target_sysroot == "") {
target_sysroot = fuchsia_sdk + "/arch/$target_cpu/sysroot"
}
}
if ((mini_chromium_is_posix || mini_chromium_is_fuchsia) &&
(current_os == target_os && current_cpu == target_cpu)) {
sysroot = target_sysroot
} else {
sysroot = ""
}