def METHOD_NAME(env=None):
    """
    Return the full path of GMT's shared library for the current OS.
    Parameters
    ----------
    env : dict or None
        A dictionary containing the environment variables. If ``None``, will
        default to ``os.environ``.
    Yields
    ------
    lib_fullnames: list of str
        List of possible full names of GMT's shared library.
    """
    if env is None:
        env = os.environ
    libnames = clib_names(os_name=sys.platform)  # e.g. libgmt.so, libgmt.dylib, gmt.dll
    # Search for the library in different ways, sorted by priority.
    # 1. Search for the library in GMT_LIBRARY_PATH if defined.
    libpath = env.get("GMT_LIBRARY_PATH", "")  # e.g. $HOME/miniconda/envs/pygmt/lib
    if libpath:
        for libname in libnames:
            libfullpath = Path(libpath) / libname
            if libfullpath.exists():
                yield str(libfullpath)
    # 2. Search for the library returned by command "gmt --show-library"
    #    Use `str(Path(realpath))` to avoid mixture of separators "\\" and "/"
    try:
        libfullpath = Path(
            sp.check_output(["gmt", "--show-library"], encoding="utf-8").rstrip("\n")
        )
        assert libfullpath.exists()
        yield str(libfullpath)
    except (FileNotFoundError, AssertionError, sp.CalledProcessError):
        # the 'gmt' executable  is not found
        # the gmt library is not found
        # the 'gmt' executable is broken
        pass
    # 3. Search for DLLs in PATH by calling find_library() (Windows only)
    if sys.platform == "win32":
        for libname in libnames:
            libfullpath = find_library(libname)
            if libfullpath:
                yield libfullpath
    # 4. Search for library names in the system default path
    for libname in libnames:
        yield libname