[gn build] Bump macOS target to 12 and make it configurable (#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.
This commit is contained in:
Daniel Bertalan 2024-09-06 10:10:25 +02:00 committed by GitHub
parent 2ee7183e38
commit 5602bd5a42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 4 deletions

View File

@ -72,9 +72,9 @@ config("compiler_defaults") {
ldflags += [ "-miphoneos-version-min=8.0" ]
}
if (current_os == "mac") {
asmflags += [ "-mmacos-version-min=10.10" ]
cflags += [ "-mmacos-version-min=10.10" ]
ldflags += [ "-mmacos-version-min=10.10" ]
asmflags += [ "-mmacos-version-min=$mac_deployment_target" ]
cflags += [ "-mmacos-version-min=$mac_deployment_target" ]
ldflags += [ "-mmacos-version-min=$mac_deployment_target" ]
}
assert(symbol_level == 0 || symbol_level == 1 || symbol_level == 2,

View File

@ -2,6 +2,10 @@ import("//llvm/utils/gn/build/sysroot.gni")
have_ios_sdks = true
declare_args() {
mac_deployment_target = "12"
}
if (sysroot == "") {
declare_args() {
# Set to true if you don't have Xcode installed, but do have the commandline

View File

@ -47,7 +47,7 @@ if (current_os == "android") {
rebase_path(mac_sdk_path, root_build_dir),
# TODO(lgrey): We should be getting this from `compiler_defaults`. Why
# aren't we?
"-mmacos-version-min=10.10",
"-mmacos-version-min=$mac_deployment_target",
]
}
} else if (current_os == "baremetal") {