forked from timniederhausen/gn-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mac_sdk.gni
55 lines (46 loc) · 1.53 KB
/
mac_sdk.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
# 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("//build/toolchain/mac/settings.gni")
declare_args() {
# Minimum supported version of the Mac SDK.
mac_sdk_min = "10.10"
# Minimum supported version of OSX.
mac_deployment_target = "10.9"
# Path to a specific version of the Mac SDK, not including a slash at the end.
# If empty, the path to the lowest version greater than or equal to
# mac_sdk_min is used.
mac_sdk_path = ""
# The SDK name as accepted by xcodebuild.
mac_sdk_name = "macosx"
}
find_sdk_args = [ "--print_sdk_path" ]
if (!use_system_xcode) {
find_sdk_args += [
"--developer_dir",
hermetic_xcode_path,
]
}
find_sdk_args += [ mac_sdk_min ]
# The tool will print the SDK path on the first line, and the version on the
# second line.
find_sdk_lines = exec_script("//build/toolchain/mac/find_sdk.py",
find_sdk_args,
"list lines")
mac_sdk_version = find_sdk_lines[1]
if (mac_sdk_path == "") {
mac_sdk_path = find_sdk_lines[0]
}
script_name = "//build/toolchain/mac/sdk_info.py"
sdk_info_args = []
if (!use_system_xcode) {
sdk_info_args += [
"--developer_dir",
hermetic_xcode_path,
]
}
sdk_info_args += [ mac_sdk_name ]
_mac_sdk_result = exec_script(script_name, sdk_info_args, "scope")
xcode_version = _mac_sdk_result.xcode_version
xcode_build = _mac_sdk_result.xcode_build
machine_os_build = _mac_sdk_result.machine_os_build