def METHOD_NAME():
    """Find the last installed version of the CommandLineTools.
    The CLT version might only affect the build if it's selected as the macOS
    SDK path.
    """
    pkgutil = Executable("pkgutil")
    output = pkgutil(
        "--pkg-info=com.apple.pkg.cltools_executables", output=str, fail_on_error=False
    )
    match = re.search(r"version:\s*([0-9.]+)", output)
    if match:
        return Version(match.group(1))
    # No CLTools installed by package manager: try Xcode
    output = pkgutil("--pkg-info=com.apple.pkg.Xcode", output=str, fail_on_error=False)
    match = re.search(r"version:\s*([0-9.]+)", output)
    if match:
        return Version(match.group(1))
    return None