Bug 1856466 - Delay setting -mmacosx-version-min flags. r=firefox-build-system-reviewers,sergesanspaille

Setting them before the first call to check_compiler can fail when the
compiler doesn't recognize the flag for its default target and actively
errors out.

Differential Revision: https://phabricator.services.mozilla.com/D189861
This commit is contained in:
Mike Hommey 2023-10-05 08:13:04 +00:00
parent 3bccb94b5d
commit eccae20a6b

View File

@ -1265,8 +1265,6 @@ def compiler(
flags.extend(("-isysroot", sysroot.path))
else:
flags.extend(("--sysroot", sysroot.path))
if host_or_target.os == "OSX" and macos_target:
flags.append("-mmacosx-version-min=%s" % macos_target)
if provided_compiler:
wrapper.extend(provided_compiler.wrapper)
flags.extend(provided_compiler.flags)
@ -1279,6 +1277,9 @@ def compiler(
android_version,
)
if host_or_target.os == "OSX" and macos_target:
flags.append("-mmacosx-version-min=%s" % macos_target)
# When not given an explicit compatibility version, clang-cl tries
# to get one from MSVC, which might not even be the one used by the
# build. And when it can't find one, its default might also not match