def METHOD_NAME(self):
    if self.settings.compiler == "Visual Studio":
        with tools.vcvars(self.settings):
            yield
    else:
        compiler_defaults = {}
        if self.settings.compiler == "gcc":
            compiler_defaults = {
                "CC": "gcc",
                "CXX": "g++",
                "AR": "ar",
                "LD": "g++",
            }
        elif self.settings.compiler == "clang":
            compiler_defaults = {
                "CC": "clang",
                "CXX": "clang++",
                "AR": "ar",
                "LD": "clang++",
            }
        env = {}
        for k in ("CC", "CXX", "AR", "LD"):
            v = tools.get_env(k, compiler_defaults.get(k, None))
            if v:
                env[k] = v
        with tools.environment_append(env):
            yield