Skip to content

Commit

Permalink
Bug 1780056: Set the deployment target for local macOS builds to 10.1…
Browse files Browse the repository at this point in the history
…2 for all platforms and enable -Werror=unguarded-availability-new. r=glandium

Differential Revision: https://phabricator.services.mozilla.com/D153277
  • Loading branch information
Stephen A Pohl committed Aug 29, 2022
1 parent 9230fb6 commit 00b74d2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
13 changes: 10 additions & 3 deletions build/moz.configure/toolchain.configure
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,19 @@ with only_when(target_is_osx):
"--enable-macos-target",
env="MACOSX_DEPLOYMENT_TARGET",
nargs=1,
default=depends(target)(lambda t: "11.0" if t.cpu == "aarch64" else "10.12"),
default=depends(target, developer_options)
# We continue to target 10.12 on Intel, but can target 11.0 for
# aarch64 since the earliest hardware was released alongside 11.0.
# For local builds, we want to target 10.12 regardless of the
# underlying platform to catch any errors or warnings that wouldn't
# show up when targeting 11.0, since these would later show up on
# CI for Intel builds.
(lambda t, d: "11.0" if (t.cpu == "aarch64" and not d) else "10.12"),
help="Set the minimum MacOS version needed at runtime{|}",
)

@depends_if("--enable-macos-target")
def macos_target(value):
@depends_if("--enable-macos-target", developer_options)
def macos_target(value, _):
return value[0]


Expand Down
3 changes: 3 additions & 0 deletions build/moz.configure/warnings.configure
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ check_and_add_warning(
),
)

# Warn if APIs are used without available() checks on macOS.
check_and_add_warning("-Werror=unguarded-availability-new", when=target_is_osx)

# Please keep these last in this file
add_old_configure_assignment("_WARNINGS_CFLAGS", warnings_flags.cflags)
add_old_configure_assignment("_WARNINGS_CXXFLAGS", warnings_flags.cxxflags)
Expand Down

0 comments on commit 00b74d2

Please sign in to comment.