Skip to content

Commit 5602bd5

Browse files
authored
[gn build] Bump macOS target to 12 and make it configurable (llvm#107492)
Bumping the deployment target from macOS 10.10 to 12 enables chained fixups and DWARF 4 debug information for the LLVM binaries and libraries. Like in Chromium, a GN arg (`mac_deployment_target`) is added to allow overriding the default.
1 parent 2ee7183 commit 5602bd5

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

llvm/utils/gn/build/BUILD.gn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ config("compiler_defaults") {
7272
ldflags += [ "-miphoneos-version-min=8.0" ]
7373
}
7474
if (current_os == "mac") {
75-
asmflags += [ "-mmacos-version-min=10.10" ]
76-
cflags += [ "-mmacos-version-min=10.10" ]
77-
ldflags += [ "-mmacos-version-min=10.10" ]
75+
asmflags += [ "-mmacos-version-min=$mac_deployment_target" ]
76+
cflags += [ "-mmacos-version-min=$mac_deployment_target" ]
77+
ldflags += [ "-mmacos-version-min=$mac_deployment_target" ]
7878
}
7979

8080
assert(symbol_level == 0 || symbol_level == 1 || symbol_level == 2,

llvm/utils/gn/build/mac_sdk.gni

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import("//llvm/utils/gn/build/sysroot.gni")
22

33
have_ios_sdks = true
44

5+
declare_args() {
6+
mac_deployment_target = "12"
7+
}
8+
59
if (sysroot == "") {
610
declare_args() {
711
# Set to true if you don't have Xcode installed, but do have the commandline

llvm/utils/gn/build/toolchain/target_flags.gni

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if (current_os == "android") {
4747
rebase_path(mac_sdk_path, root_build_dir),
4848
# TODO(lgrey): We should be getting this from `compiler_defaults`. Why
4949
# aren't we?
50-
"-mmacos-version-min=10.10",
50+
"-mmacos-version-min=$mac_deployment_target",
5151
]
5252
}
5353
} else if (current_os == "baremetal") {

0 commit comments

Comments
 (0)